LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-09-2014, 08:21 PM   #1
ericjs
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Rep: Reputation: Disabled
Incorect superblock after dd copy ran out of space on dest


Quite some time ago I had the bright idea to backup my system partition by doing a dd to another partition I wasn't using for anything else. I had several such partitions approximately the same size I had used to audition several different distros before chosing the one I eventually went with (Chakra).

I ran

Code:
sudo dd if=/dev/sda2 of=/dev/sda6 bs=4096 conv=notrunc,noerror
and wound up getting an error result of

Code:
dd: writing ‘/dev/sda6’: No space left on device
12544001+0 records in
12544000+0 records out
51380224000 bytes (51 GB) copied, 2426.37 s, 21.2 MB/s
I'd forgotten that "approximately" part or perhaps didn't realize that dd would do more than just copy the used portion of the disk. The problem was that the target partition was a tad smaller than the source.

While I knew it had failed, it didn't seem to harm anything and I wasn't sure what to do about it, so I proceeded to ignore it for many months. I at least had the wherewithall to record what I'd done. I did sometimes see an error about it during boot, and fsck reports

Code:
The filesystem size (according to the superblock) is 12800000 blocks
The physical size of the device is 12544000 blocks
Either the superblock or the partition table is likely to be corrupt!
More recently I had another bright idea to try to take a look at something on this old snapshot of my system partition, and went into KDE Partition Manager, and changed the mount point to try to mount it. In that tool the mount point showed as / same as my system partition. I changed it and next time I tried to boot, booting failed.

Luckily KDE Partition Manager had saved a backup of fstab before modifying it, and I was able to revert to that and boot again. Looking at the copy of fstab that wouldn't boot, the / partition is not in there at all, leading me to think that what confused something was both of these partitions having the same UUID.

In any case, I'd like to fix this before I get myself into more trouble. I've done a lot of web searching and reading (mke2fs -S sounds promising) but am not 100% confident of my grasp of what I've read, and would like some advice on the best / safest way to fix this. I don't care about the data on my /dev/sda6 partition, I would just be happy to have the superblock with the right data and not have conflicting UUIDs or mount points.

Hope this wasn't too long-winded, but maybe it serves as a cautionary tale...

Thanks,
Eric

Last edited by ericjs; 11-10-2014 at 08:52 PM.
 
Old 11-09-2014, 10:01 PM   #2
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
If you do not care about sda6 data "mke2fs -S" is the way to go. "-S" option especially intended for fixing incorrect superblock. And do not forget to run fsck on this partition after mke2fs to check it

P.S.
KDE partition manager is outstanding crap.

Last edited by Teufel; 11-09-2014 at 10:03 PM.
 
Old 11-09-2014, 10:23 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If you don't care about the data on sda6 simply do "mkfs.ext4 /dev/sda6" (change ext4 to something else if you want). Problem solved as a different UUID will be assigned.

Some comments:
- dd is the worst tool for backups.
- a broken backup is no backup at all
- when mounting backups, use device specific nodes rather than UUID in case of conflicts like this.
 
Old 11-09-2014, 11:24 PM   #4
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by syg00 View Post
Some comments:
- dd is the worst tool for backups.
Whats wrong with dd? If you do not know what are you doing - it isn't a dd issue. It's your issue.
dd is the best tool I've seen ever in unix world.
 
Old 11-09-2014, 11:37 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by Teufel View Post
Whats wrong with dd? If you do not know what are you doing - it isn't a dd issue. It's your issue.
Absolutely agree.
Quote:
dd is the best tool I've seen ever in unix world.
For what it was designed for. Great for recovery/forensics situations. For user data the last thing you want is for filesystem/file errors being silently copied as your supposedly "good" backup.
All backups must be valid - and IMHO verified. dd doesn't do that.
 
Old 11-09-2014, 11:59 PM   #6
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by syg00 View Post
For user data the last thing you want is for filesystem/file errors being silently copied as your supposedly "good" backup.
Do not use conv=noerror. dd will warn you if something wrong.
 
Old 11-10-2014, 12:14 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Nope - not on filesystem errors. If dd can read the sector, it'll just write it out. Regardless of the contents - as it is designed to do.
 
Old 11-10-2014, 05:13 AM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,484

Rep: Reputation: Disabled
As others have said, there is nothing wrong with 'dd', it was 'user error'.
(It would be nice if you altered the title to reflect this).

Try using 'tar' next time.
 
Old 11-10-2014, 09:18 AM   #9
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by syg00 View Post
Nope - not on filesystem errors. If dd can read the sector, it'll just write it out. Regardless of the contents - as it is designed to do.
Exactly. dd does what it intended for. It creates backup. There are other tools for filesystem checking (fsck e.t.c.)
Let say you have a filesystem with error. Does dd somehow interfere you or confuse you regarding this error? No. Does dd somehow mask this error or make it unrecoverable? No. Eventually you will be faced with this error and can fix it. Error fixing just moved at later date. It will be the same fsck that you could use before backup creation.

Last edited by Teufel; 11-10-2014 at 09:19 AM.
 
Old 11-10-2014, 09:24 AM   #10
ericjs
LQ Newbie
 
Registered: Nov 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks, Teuful and syg00.

fatmac, I think "botched" does imply user error, but I'm open to suggestions if some other wording better fits the conventions around here, or if will make this thread easier to find by someone with a similar problem.
 
Old 11-10-2014, 10:10 AM   #11
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
May be something like "Incorrect superblock" or "Running out of partition on copy". Something more informative than "botched"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! I botched LVM and botched most of system!!! Labyrinth Linux - Newbie 7 01-08-2008 04:50 AM
Sabayons Botched up KDE reiko007 Linux - Distributions 2 12-04-2007 11:01 PM
vmware botched install leupi Ubuntu 3 01-22-2007 06:33 PM
Sarge botched boot bretticus Debian 2 07-26-2005 04:14 PM
Botched a Friends Computer!! flamesrock General 4 06-07-2004 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration