You are not logged in.

#1 2015-12-28 06:30:02

antnythr
Member
Registered: 2014-08-27
Posts: 36

Cloned HDD to SSD with rsync and lost 40GB of space?

I got my first SSD and used rsync to clone the HDD to the SSD. Both drives are 500GB and have the same partition layout. The space used on the SSD is ~40GB more than on the HDD.

When I look at the folder properties of each folder, the space taken up by each folder on the new SSD more or less matches the space occupied by the folder on the old HDD. The discrepancy doesn't appear to be some giant file or series of files.

I used tune2fs to set the reserved space on both drives to 1%, so that doesn't account for the missing space either.

I'm totally new to SSDs, so is there something about them that is using an extra 40GB of space that I'm not aware of?

Offline

#2 2015-12-28 07:35:00

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

What if you compare with this?

[tom@localhost ~]$ sudo du -d 1 -x -h /
2.0G	/var
15M	/etc
2.6G	/usr
25M	/boot
7.5G	/home
0	/mnt
0	/opt
204K	/root
32K	/srv
13G	/

The ~1G difference (13 - 2 - 2.6 - 7.5) is probably metadata in my case:

[tom@localhost ~]$ btrfs fi df /
Data, single: total=17.01GiB, used=11.96GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.00GiB, used=209.09MiB
GlobalReserve, single: total=80.00MiB, used=0.00B

Last edited by tom.ty89 (2015-12-28 07:39:20)

Offline

#3 2015-12-28 08:09:18

antnythr
Member
Registered: 2014-08-27
Posts: 36

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

Thanks for the reponse.

So I somehow managed to stumble across a 40GB file under /var/lib/libvirt/images/ from an old virtual machine (which was on both the new and old drives).

When I deleted the file on the SSD, I gained 40GB of space. When I deleted the file on the HDD, the free space didn't increase (which seems odd).

Anyway, both drives now show within 500MB of each other, so it seems the issue is resolved (I think).

Offline

#4 2015-12-28 14:33:50

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

antnythr wrote:

When I deleted the file on the SSD, I gained 40GB of space. When I deleted the file on the HDD, the free space didn't increase (which seems odd).

That sounds like a sparse file - and I guess you did not pass the `--sparse` option to rsync?


pkgs │ hacks │ cfg │ blag

Offline

#5 2015-12-28 14:49:33

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

ayekat wrote:
antnythr wrote:

When I deleted the file on the SSD, I gained 40GB of space. When I deleted the file on the HDD, the free space didn't increase (which seems odd).

That sounds like a sparse file - and I guess you did not pass the `--sparse` option to rsync?

Speaking of options, did you (antnythr) use the options suggested here?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2015-12-28 16:11:46

antnythr
Member
Registered: 2014-08-27
Posts: 36

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

ayekat

After reading up on it, that definitely sounds like the issue. You are correct that I didn't pass the "--sparse" option.

alphaniner

I did indeed use the command from that page exactly as it is written.

Offline

#7 2015-12-28 17:24:48

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Cloned HDD to SSD with rsync and lost 40GB of space?

Actually, "exactly as written" isn't actually best in this case IMO. A bit further down, there's this:

If you are a heavy user of hardlinks, you might consider adding the -H option, which is turned off by default as memory expensive, but nowadays it should be no problem on most modern machines. There are a lot of hard links below the /usr/ folder, which save disk space.

So if you didn't use -H more space will be used on the destination. Probably minimal though, just FYI.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

Board footer

Powered by FluxBB