2
I'm looking for a Linux equivalent of the command Robocopy /CREATE
, which recreates a complete empty file tree with all the attributes of folders and files in the source, except the files' contents. Rsync, which is said to be the equivalent of Robocopy for general file synchronization purposes, doesn't seem to have a similar option.
I'm recovering data from a 4TB hard disk drive, with the main partition formatted in Ext4, so far I could clone 47% with HDDSuperClone until it started to suffer serious issues, but the partition is still not accessible on the recovery drive, while recovery softwares like R-Studio and DMDE can't reconstruct the original metadata structure, and the drive's current degraded condition may not allow to recover significantly more useful data.
So, since the original drive can still be mounted on Lubuntu (albeit with difficulty), if I have to resort to “raw file carving”, i.e. scan the recovered data with tools that detect file signatures and extract all detected files in bulk (I'm using mainly R-Studio and Photorec for that purpose), I'd like to at least provide the drive's owner with a way of sorting such a mess more conveniently than doing it from scratch with no reference.
Obviously, in such a context, the command I'm looking for should proceed quickly and only analyze a few key filesystem structures, not involve a thorough scan of the partition which would only wear out that drive further.
Have you looked at this Rsync-related article online: “Linux: rsync Copy Directories Structures Tree Only” Seems like it can do what you are asking to do.
– JakeGould – 2019-05-26T03:40:56.483Thank you for this quick reply, but apparently the proposed command copies directories only, what I'd like is the strict equivalent of Robocopy /CREATE, which also copies files, but with a size of 0 byte (I use that a lot to keep snapshots of file trees). It could be a script with a combination of commands. I read about the
touch
command which can create empty files, perhaps a simple script could create an empty file on the destination for each file in the source, with the same name, path, if possible timestamps. But I'm not familiar enough with the Linux environment to write such a script. – GabrielB – 2019-05-26T04:20:59.257Well, asking for a script to be written is not going to go over well here, but I see what you mean and think it’s a decent question. – JakeGould – 2019-05-26T04:22:34.310
2Not exactly what you need - but if linux sees it - gnu ddrescue might be worth a try – Journeyman Geek – 2019-05-26T08:38:32.773
1GNU
ddrescue
is a good first step. It will rescue as much of the disk raw data as it can. Then you work with the copy, so you certainly don't "wear out that drive further". – Kamil Maciorowski – 2019-05-26T08:51:00.597HDDSuperClone is a newer software with the same purpose as ddrescue (recovering data from defective storage devices as efficiently as possible) and a roughly similar operation, with some enhancements and added features. The problem is that this is a 4TB drive with only about 550GB of actual data according to GParted, and one of the drive's heads (out of 8) completely failed about midway through (after reading ~1.5TB of 00s...). So now I'm looking for a way to restrict the recovery to the allocated areas, to get the most out of what's left. I'll create another question on that subject. – GabrielB – 2019-05-26T14:26:52.593
Linked question here : https://superuser.com/questions/1441413/analyse-allocated-space-in-ext4-partition-to-improve-data-recovery-efficiency
– GabrielB – 2019-05-26T16:58:12.910