linux – Not a file, not a folder, but a hard link(?) to /bin from another partition – scared to delete

I have a not-quite-folder not-quite-file on my file system. It is an AWS EC2 instance running Ubuntu 18.04.4 LTS.

I have a script that runs nightly that picks up a file (/ebsvol/dead-drop/sync) and moves it to (/ebsvol/dead-drop/sync) using Robo, which in turn is using Symfony’s Filesystem rename() method (https://symfony.com/doc/current/components/filesystem.html#rename).

  const CANARY_PATH = '/ebsvol/dead-drop/sync';
  const CANARY_WORKING_PATH = '/ebsvol/dead-drop/~sync';
...
  $this->taskFilesystemStack()
    ->rename(self::CANARY_PATH, self::CANARY_WORKING_PATH)
    ->run();

Something is going awry in the script or with this code, though that’s not really why I’m here. The result and cleanup is why I’m here. 🙂

The result is that the ~sync “file” is created, however it is actually… a hard link to /bin? This is where things get fishy. My ls -ial looks like this:

3276803 -rw-rw-r--  1 configbot configbot  125 Jul  4 00:30 '~sync'

So it’s just a text file, so let’s try cat…

$ cat ~sync
cat: /bin: Is a directory 

Uhh, OK.

$ cd ~sync

…changes my prompt to /bin, and doing an ls, it’s surely bin. Incidentally, ls -ial on my root volume shows that /bin is iNode 12.

This has happened to me once in the past, and I just did rm -rf ~sync which hosed my entire server and I had to rebuild. So I’m trying to avoid that.

How do I get rid of this weird ~sync file/folder/symlink/hardlink without trashing /bin?

Some additional info:

  • /ebsvol is a separate EBS volume than / (i.e. separate hard drives/partitions!)
  • I think if it’s a hard link in some weird way, rm ~sync might work. But wouldn’t it show identical iNode numbers?
  • I will take a snapshot of both volumes before I attempt anything. 🙂

composition – What to look out for when shooting in direct sunlight, causing hard shadows and shiny patches on water?

I am aware that this question might be labelled as off-topic, but the issue bothers for some days now, and I figured my best bet to get an answer is here on this site.

Whenever I look at pictures I have taken on bright, sunny days, I feel like shiny patches on water or hard shadows enhance the perceived brightness of the picture. Often to a point where it feels exhausting to look at.

See this picture I took in Inverness as an example:
enter image description here

Are such conditions something to avoid if I am still a beginner? What to look out for?

hard drive – Just received a quote to repair an HDD that went bad on my old laptop 5-6 years ago. Was quoted ~$1750 to retrieve data, really? Is this a rip off?

About 5 or 6 years ago I had a laptop HDD go bad on me (wouldn’t boot anymore). I removed the HDD and have had it stored away since then because it has almost all of our pictures/videos of my son’s very early years. It is very important to my wife and me, obviously.

Recently I tried to connect it to my PC using a SATA cable, but I could not get BIOS to recognize the disk exists. I can hear/feel the HDD spin, but no matter what connections I used I could not get BIOS to see it.

Considering the importance of the data I sent it to werecoverdata.com and paid a $95 diagnostics fee.

The quote I was provided was $1750, (the cheapest of the time frame options). I asked what the issues were and this is what I was told: “The hard drive is unstable and has System Area issue.”

I’ve done some googling and see a lot of references to programs that allegedly fix unstable sectors, which I’m assuming is what “unstable” means. System Area doesn’t mean much to me.

Ultimately I need the data off of the HDD, but $1750 seems pretty steep, especially if they just run some program I can download for $50 to get the data off.

I could really use some other opinions, ideas, thoughts on this price.

reference request – Is realization of unit disk graphs hard?

It is known that recognizing a unit disk graph is NP-hard (1).

However, the paper does not mention how hard is the realization problem.

I have looked up several references (2)(3)(4). None of the papers answer whether the following problem is NP-hard:

Given a unit disk graph $G = (V,E)$, find a configuration of a set
$mathcal{D}$ of disks, such that the intersection graph
$G(mathcal{D})$ of $mathcal{D}$ is isomorphic to $G$.

The difference between this problem and the recognition problem is that the input of this problem is guaranteed to be a unit disk.

Is there any study that shows the complexity of the above problem? I expect it to be NP-hard, but I am yet to find a full proof.

How hard is hosting on AWS?


I’m currently managing a small network of sites on reseller hosting.

Although I’m happy with the company, I’m beginning to want to do more in terms of creating backups than the infrastructure is really designed to support (e.g. running daily automated incremental backups that will capture both the databases and the filesystem).

VPS is an option … but somebody mentioned AWS.

How hard is hosting on AWS? I have some basic familiarity with EC2, S3, IAM and a few other services. But am I right in saying that for your average semi-technical (amateur) webmaster it’s simply a step too far in terms of technicality?

hard drive – Why hasn’t anyone invented spanning/merging 2 partitions from same disk with different file allocation sizes to utilize wasted disk space?

In the following scenario (for demonstration purposes), a disk must contain 500,000 tiny files (each exactly 2 kilobytes), and 500,000 large files (each 32 megabytes), totaling altogether 16.001 terabytes:

Let’s pretend the chosen file-system is exFAT (which supports an Allocation Unit Size between roughly 2 kilobytes – 32.768 megabytes).

If the disk is formatted with an Allocation Unit Size of 2 kilobytes (smallest exFAT option), it unfortunately reduces I/O performance of larger files.

If the disk is formatted with an AUS of 32 megabytes (largest exFAT option), this ends up wasting tons of space since each tiny file wastes 31.999 megabytes per file; all million files waste about ~32 terabytes of wasted space.

Why hasn’t any manufacturer designed a disk (or some firmware) that partitions a disk into 2 partitions, each with a different AUS (one with the smallest, one with the biggest)? Then, this disk can automatically manage (without OS intervention) file changes, keeping larger files in one partition, and smaller files in the other? Both partitions could look like a single drive, or spanned drive? Or is this basically the concept of compressing files into a .zip?

This could be simulated with a massive .iso disk image, or VHD residing on a disk formatted at the highest AUS level. The large files can reside in the disk, while small files can reside in the virtual disk image. Many OSes can mount the disk, with this disk being formatted with the smallest AUS.

What are some technical setbacks, or explanations why this wasn’t done?

Install MacOS (Snow Leopard) on a clean hard drive, from windows pc, from iso or whatever else

Problem:
A friend have a MacOS computer. The hard disk inside started ticking (probably stuck heads). Hard disk was unusable.

He bought an empty hard disk but when he replaced it, it was giving a folder with a question mark icon (missing OS I suppose).

He brought me the empty hard disk asking me to reinstall OS on it. I never used Apple products.

I usually do this kind of stuff for windows and I prepare a bootable usb drive with the Windows OS on it. Plug the usb in the computer and install windows.

How to install MacOS on a clean & virgin hard drive so he can put the hard disk back on the Macbook and use it?

tl;dr: I need from Windows to install from an ISO or whatever, the Snow Leopard OS on a clean and new Hard disk, and put it back on a mac computer with the OS on it so it can start.

Photos folder on external hard drive incessant disk usage for 5 years

My photos collection has way over 500 gigabytes, and when I got a new Mac in 2015, I moved the collection to an external hard drive, and pointed Photos (iphoto by then?) to the external hard drive.

So far, so good. Everything works most of the time, with all the known glitches of Photos which are covered in many other questions.

My question is regarding disk usage. My hard drive is being used 100% of the time (and quite loudly), since 2015. The thing NEVER stops.

I have spotlight disabled for that hard drive, and the people search doesn’t show anything anymore (like that “X images still need to be scanned).

The processes using the hard drive are

  • mds
  • filecoordinationd (4 threads, same PID)
  • com.apple.MediaLibraryService (also 4 threads, 1 pid)
  • photolibraryd (12 threads)
  • cloudphotod
  • com.apple.CloudPhotosConfiguration (4 threads)
  • revisiond (4 threads).

If I kill all those processes, I end up with fseventsd in 1 thread, 28 threads of photoanalysisd, 1 thread of mds, and 4 threads of revisiond. It quiets things for a while, and the activity comes back after a while.

Why is this happening and how to fix it?
Again, this is bothering me for FIVE YEARS. It’s not something temporary.