You are not logged in.
I recently needed to restore a full disk From an image I made following the wiki.
I made an image:
dd if=/dev/sde conv=sync,noerror bs=64K | gzip -c > /path/to/backup.img.gzI used this to restore the entire disk:
gunzip -c /path/to/backup.img.gz | dd of=/dev/sdeBut after the dd restore completed it said:
Not enough space on diskBut when I tried to boot everything works fine. It's the exact same disk, why would I get this error? Should I be worried?
Last edited by STREBLO (2015-10-01 20:52:17)
Offline
Not a Sysadmin issue, moving to NC...
Offline
It should be fine, but I'd probably run a manual fsck to be sure.
As for the reason:
You used 'sync' and 64K block size for the image.
'sync' pads incomplete (=the last one) input blocks with NUL bytes.
Your hard disk either works with 512 or 4096 byte sectors ('fdisk -l' will tell you), so the image is <64K larger than your disk.
1000
Offline
It should be fine, but I'd probably run a manual fsck to be sure.
As for the reason:
You used 'sync' and 64K block size for the image.
'sync' pads incomplete (=the last one) input blocks with NUL bytes.
Your hard disk either works with 512 or 4096 byte sectors ('fdisk -l' will tell you), so the image is <64K larger than your disk.
My fdisk -l output was
Disk /dev/sde: 447.1 GiB, 480103981056 bytes, 937703088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B29F28B8-49F3-4C1E-9EAE-381DAD0D01F8
Device Start End Sectors Size Type
/dev/sde1 2048 1050623 1048576 512M EFI System
/dev/sde2 1050624 84936703 83886080 40G Linux root (x86-64)
/dev/sde3 84936704 937703054 852766351 406.6G Linux homeSo should I have not have used sync on the back up? Should I have checked the block size before making the image and used 512?
fsck gave me
~ » sudo fsck /dev/sde2 john@Archie
fsck from util-linux 2.26.2
e2fsck 1.42.12 (29-Aug-2014)
Archon_(/): clean, 250241/2621440 files, 3191996/10485760 blocks
------------------------------------------------------------
~ » sudo fsck /dev/sde3 john@Archie
fsck from util-linux 2.26.2
e2fsck 1.42.12 (29-Aug-2014)
Archon_/home: clean, 36322/26656768 files, 15661018/106595793 blocks
------------------------------------------------------------
~ » sudo fsck /dev/sde1 john@Archie
fsck from util-linux 2.26.2
fsck.fat 3.0.28 (2015-05-16)
/dev/sde1: 21 files, 7315/130812 clustersWould i be best off doing a reinstall?
Offline
A thorough fsck would mean 'e2fsck -vf /dev/sdeX'.
And don't reinstall, everything should be fine, the difference in the image are just zeroes/NULs.
1000
Offline