Ext3 file system UUID
tune2fs -l /dev/sda11 | grep UUIDHere is an output:
Filesystem UUID: 0827dce3-d1c0-41b1-bc6f-0d4cfa0a1849
XFS file system UUID
xfs_admin -u /dev/sda13Here is an output:
UUID = f128170a-1ee4-4b4f-abe7-0acf169bb8ae
Simplicity and elegance are unpopular because they require hard work and discipline to achieve and education to be appreciated. — Edsger W. Dijkstra
tune2fs -l /dev/sda11 | grep UUIDHere is an output:
Filesystem UUID: 0827dce3-d1c0-41b1-bc6f-0d4cfa0a1849
xfs_admin -u /dev/sda13Here is an output:
UUID = f128170a-1ee4-4b4f-abe7-0acf169bb8ae
VBoxManage modifyhd --compact my-virtual-drive.vdiPlease note, that you can compact only drives that are registered with VirtualBox Media Manager.
A hard disk with UUID ... is already registered.In this case what you need is re-generate UUID for the VDI image. Here is how you can do that:
VBoxManage internalcommands setvdiuuid my-virtual-drive.vdiThis way the virtual drive my-virtual-drive.vdi will be assigned a new UUID so it can be registered in VirtualBox Media Manager.
deby:~# time dd if=/dev/zero of=file bs=1024 count=1000000 1000000+0 records in 1000000+0 records out 1024000000 bytes (1.0 GB) copied, 13.454 s, 76.1 MB/s real 0m13.696s user 0m0.240s sys 0m5.924sSame way we can read that file back into a memory (/dev/shm):
deby:~# time dd if=file of=/dev/shm/file 2000000+0 records in 2000000+0 records out 1024000000 bytes (1.0 GB) copied, 4.19182 s, 244 MB/s real 0m4.334s user 0m0.592s sys 0m3.740sRead more about dd command here.
deby:~# xfs_db -c frag -r /dev/sda10 actual 2903, ideal 2418, fragmentation factor 16.71%Once you see it is pretty high, e.g. above 40% you would need to issue the following command that defragment the drive:
deby:~# xfs_fsr -v /dev/sda10 /home start inode=0