0

So, I currently use Ubuntu mostly for backing up data on broken computers. Recently, though, I wanted to back up a system completely. The harddrive had 300GB of storage. I mounted the main partition on the drive (NTFS) and copied all the files to an external drive (NTFS). As I waited for it to calculate how much it would be copying, the size it was reporting continued increasing, even beyond 300GB. (I never let it finish - I just backed up what was necessary.)

I'm now backing up yet another harddrive (NTFS again) - a 500GB one to another external drive (NTFS). I was not able to mount the drive; so, this time I'm generating an image of it via the terminal "cat" command. I now found that the file it's generating has already exceeded 650GB and is still going. (Edit: it's now just past 850GB)

What am I missing here? How can a drive have more information on it than it's physical size can hold? Or perhaps, what am I copying recursively? It might make some sense for the mounted HDD, but how could it possibly be more for the one I haven't even mounted? Or am I using the "cat" command wrong? sudo cat /dev/sdc > "/media/ExternalDriveName/hdd-backup.img"

2 Answers 2

1

Well, I did some research to find out that my conception was wrong; and I do have an answer.

The Linux/Ubuntu /dev/ folder contains a list of device IO interfaces, not so much files. Here's a link to where I discovered this.

So, instead of reading a file, and dumping it to a file, I was reading an output stream, and dumping it to a file. Of course, output streams don't necessarily have any beginning or end, and can be read indefinitely. Thus, I have no idea what's in my backup file, other than what the HDD output while I was querying it.

0

What is the type of the file system you are backing files to? I guess since you are backing up on a ubuntu it is ext4.

Different filesystems may have differing overhead while allocating space for files.

In data storage, the smallest amount of disk space that can be allocated to hold a file is called a cluster. Most files are not the same size as the cluster size on a hard disk. The difference between the actual file size and the cluster size is called file slack. File slack is wasted space. There will always be wasted space no matter what size the clusters are. File size plus file slack equals Size on disk.

If your hard drive has 4KB cluster size and you have a file that is 1KB, File Properties will show:

Size: 1.00KB (1,024 bytes) Size on Disk: 4.00KB (4,096 bytes)

You can read more about Clusters on wikipedia

https://en.wikipedia.org/wiki/Data_cluster

So the short answer is that on different file system you will have different file sizes.

The comparasion of different file systems:

https://en.wikipedia.org/wiki/Comparison_of_file_systems

EDIT: you can also read this answer:

Why Same File Shows Different Sizes in Different Operating Systems

1
  • Everything is NTFS (New Technology File System) - I said that. But for the second HDD, I can't mount the file system. So, when "cat" transferring the HDD image, how would the file system have an effect?
    – Codesmith
    Mar 15, 2015 at 12:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .