Help--restored backup using DD
When I use the linode disk image as the of= target, the resulting partition size is smaller than the linode disk image size. For example, on the disk image for the Home directory, the linode size is 5000MB, but when I do a df -h with it mounted (as /dev/xvdd) the size is shown only as 2GB. I've tried dd with the conf=notrunc, but no help there.
Is there any way to recapture the unused space in this disk image? It would appear that since linode disk images use the same nomenclature as do normal partitions, that partitioning software won't help.
I would be just as happy copying data from one linode disk image into another, as long as both the OS disk image is still bootable, and the Home image functions with cPanel the way it does now.
5 Replies
e2fsck -v -C0 -f /dev/xvdd
resize2fs /dev/xvdd
You can also do this without rebooting into finnix if the partition is dismounted first (and isn't your root fs).
Thank you.
I've since restored again to the backup image, but am still looking to recover some unusable space on the root partition/image. The disk image size is 5000MB and a df -h shows only 4.1GB total size for that partition.
There's only 400MB of free space on the partition, and I'm not comfortable leaving it at that, so I still need to recapture some of the 900MB of unrecognized space on /dev/xvdd.
If it helps, the only thing this profile has is the base CentOS image, a cPanel/WHM installed by them, and the csf plug-ins installed by configserver staff. I have basically left it alone from there.
Any further help would be greatly appreciated.
Some alternate things you can try:
1) If the partition is listed as 'ext2' or 'ext3' in the LPM, change the size of the partition from the LPM, and it should resize it to fill the specified size. If you like the current size, just reduce the size and increase it back.
2) As a last resort, you could create a new partition, then 'cp -a' to copy everything from the old to the new.
I'll try those alternatives tomorrow when another maintenance window opens up.
BTW…will the cp -a command work for a boot drive?
Thanks again for the input.