You are not logged in.

#1 2015-09-30 05:47:09

STREBLO
Member
Registered: 2015-02-15
Posts: 135

[SOLVED] System Backup and Restore - Not Enough Space

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.gz

I used this to restore the entire disk:

gunzip -c /path/to/backup.img.gz | dd of=/dev/sde

But after the dd restore completed it said:

Not enough space on disk

But 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

#2 2015-09-30 06:15:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] System Backup and Restore - Not Enough Space

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-09-30 06:47:33

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] System Backup and Restore - Not Enough Space

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

#4 2015-09-30 21:46:34

STREBLO
Member
Registered: 2015-02-15
Posts: 135

Re: [SOLVED] System Backup and Restore - Not Enough Space

byte wrote:

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 home

So 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 clusters

Would i be best off doing a reinstall?

Offline

#5 2015-09-30 23:38:26

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: [SOLVED] System Backup and Restore - Not Enough Space

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

Board footer

Powered by FluxBB