I'd really appreciate some help with this but I do fear the worst.
Yesterday I had a broken super block on my boot drive sda1 which I fixed by finding the backup superblocks with:
mke2fs -n /dev/sda1
Then by replacing the corrupted superblock with:
e2fsck -b <backup_superblock_number>/dev/sda1
This I thought had fixed the problem, Linux booted up went through a fschk on all disks which passed and gave me a desktop that seemed okay. I left it over night and thought I'd grab the home partition and replace the physical disk in the morning to be on the safe side.
Today I can't see sda?
lsscsi returns:
[0:0:0:0] cd/dvd SONY DVD RW AW-G170A 1.71 /dev/sr0 [2:0:0:0] disk ATA WDC WD5000KS-00M 07.0 /dev/sda [3:0:0:0] disk ATA ST31500341AS CC1H /dev/sdb [4:0:0:0] disk ATA ST31500341AS CC1H /dev/sdc [6:0:0:0] disk Generic USB SD Reader 1.00 /dev/sdd [6:0:0:1] disk Generic USB CF Reader 1.01 /dev/sde [6:0:0:2] disk Generic USB SM Reader 1.02 /dev/sdf [6:0:0:3] disk Generic USB MS Reader 1.03 /dev/sdg [7:0:0:0] disk SanDisk Cruzer Micro 8.01 /dev/sdh
So the node sda is there and the physical disk is being reported correctly. sda1 is not seen in gparted and fdisk -l doesn't show it up either.
mke2fs -n /dev/sda1 returns:
mke2fs 1.42 (29-Nov-2011) Could not stat /dev/sda1 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
There is obviously something wrong with the disk which I'm going to replace but I would like to get the data from /home if at all possible. This isn't a raid disk or anything fancy just standard ext3 with 1 primary partition / and an extended partition containing a swap partition. Any help from the ALUG Community in getting me to my data would be greatly appreciated.
Cheers, BJ
On 18 October 2012 19:13, John Woodard mail@johnwoodard.co.uk wrote:
Yesterday I had a broken super block on my boot drive sda1 which I fixed by finding the backup superblocks with:
mke2fs -n /dev/sda1
Then by replacing the corrupted superblock with:
e2fsck -b <backup_superblock_number>/dev/sda1
sda1 is not seen in gparted and fdisk -l doesn't show it up either.
Suggests the MBR (or GPT if that's what you use) was destroyed. Did you make a printout of the MBR when you partitioned it?
I *wonder* (but i have no idea if this is possible) if the MBR was toasted (from before) and then you ran mke2fs it would have used the wrong parts of the drive to give you the location of another superblock that would have been created had there been a partition of a different layout?
Then e2fsck would replace a superblock it thinks is there (but maybe isnt the right offset if the partitions were toast) onto a location that would not make sense? Just guessing....
You'd probably want to check the MBR manually, as well as looking for the partitions, and also decoding ext[2,3,4] superblock 0 or the one you recovered from. Not sure if there are tools to do this for you....
dd and hexdump are your friends, and the layout specs for the MBR and ext[2,3,4] superblocks.
Regards, Srdjan
On 18 October 2012 20:15, Srdjan Todorovic todorovic.s@googlemail.comwrote:
On 18 October 2012 19:13, John Woodard mail@johnwoodard.co.uk wrote:
Yesterday I had a broken super block on my boot drive sda1 which I fixed
by
finding the backup superblocks with:
mke2fs -n /dev/sda1
Then by replacing the corrupted superblock with:
e2fsck -b <backup_superblock_number>/dev/sda1
sda1 is not seen in gparted and fdisk -l doesn't show it up either.
Suggests the MBR (or GPT if that's what you use) was destroyed. Did you make a printout of the MBR when you partitioned it?
No this was just a std. Ubuntu install which used all the defaults on a single disk so I taking a copy of the MBR was way down the list of priorities which are of course headed by beer and sandwiches.
I *wonder* (but i have no idea if this is possible) if the MBR was toasted (from before) and then you ran mke2fs it would have used the wrong parts of the drive to give you the location of another superblock that would have been created had there been a partition of a different layout?
Then e2fsck would replace a superblock it thinks is there (but maybe isnt the right offset if the partitions were toast) onto a location that would not make sense? Just guessing....
When I replaced the superblock using advice from http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superbloc... worked, I had a desktop, networking was okay etc.
You'd probably want to check the MBR manually, as well as looking for the partitions, and also decoding ext[2,3,4] superblock 0 or the one you recovered from. Not sure if there are tools to do this for you....
dd and hexdump are your friends, and the layout specs for the MBR and ext[2,3,4] superblocks.
It's looking way above my head but I ought to at least give it a go. I have full access with a live cd what is the best place to start?
Cheers, BJ
On 18 October 2012 20:30, John Woodard mail@johnwoodard.co.uk wrote:
When I replaced the superblock using advice from http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superbloc... everything worked, I had a desktop, networking was okay etc.
Cant see anything immediately wrong...
It's looking way above my head but I ought to at least give it a go. I have full access with a live cd what is the best place to start?
It's fairly complicated. :-( Depends really how important your files were to you and how much effort and time you want to spend.
You want to check the partition entries at offset 446 bytes into the MBR:
https://en.wikipedia.org/wiki/Master_boot_record#Sector_layout
If it's all zeros... then it would seem you lost your partitions. You will want to make sure any data in that section specifies sensible values for your hard drive and partitions.
Regards, Srdjan
On 18 October 2012 20:54, Srdjan Todorovic todorovic.s@googlemail.comwrote:
<snip>
It's fairly complicated. :-( Depends really how important your files were to you and how much effort and time you want to spend.
You want to check the partition entries at offset 446 bytes into the MBR:
Do I need to use dd to copy so many bytes or is there a tool I can use to view?
https://en.wikipedia.org/wiki/Master_boot_record#Sector_layout
If it's all zeros... then it would seem you lost your partitions. You will want to make sure any data in that section specifies sensible values for your hard drive and partitions.
Regards, Srdjan
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On 18 October 2012 21:01, John Woodard mail@johnwoodard.co.uk wrote:
You want to check the partition entries at offset 446 bytes into the MBR:
Do I need to use dd to copy so many bytes or is there a tool I can use to view?
Something like:
sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446
Regards, Srdjan
On 18 October 2012 21:18, Srdjan Todorovic todorovic.s@googlemail.comwrote:
On 18 October 2012 21:01, John Woodard mail@johnwoodard.co.uk wrote:
<snip>
Something like:
sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446
Pipe it to hexdump of course, why didn't I think of that, sorry I was being dense, a definite Homer moment there Doh!
On top of all this I'm having to approve all my own posts because of suspicious headers! All good fun, I'll let you know how I get on.
Cheers, BJ
On Thu, Oct 18, 2012 at 09:55:03PM +0100, John Woodard wrote:
On top of all this I'm having to approve all my own posts because of suspicious headers!
If you stopped posting in HTML you wouldn't have to.
J.
On 18 October 2012 20:18, Srdjan Todorovic todorovic.s@googlemail.com wrote:
sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446
I got this returned
xubuntu@xubuntu:~$ sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446 0+0 records in 0+0 records out 0 bytes (0 B) copied, 0.000170134 s, 0.0 kB/s
Does this mean I'm screwed?
Apologies to the list admins apparently I have been posting in html! My only defence is that this is being posted from a live distro using default settings in gmail, I should have checked so please feel free to administer me some clue with a lart! ;-)
Cheers, BJ
On 18 October 2012 22:14, John Woodard mail@johnwoodard.co.uk wrote:
On 18 October 2012 20:18, Srdjan Todorovic todorovic.s@googlemail.com wrote:
sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446
I got this returned
xubuntu@xubuntu:~$ sudo dd if=/dev/sda count=1 bs=512 | hexdump -s 446 0+0 records in 0+0 records out 0 bytes (0 B) copied, 0.000170134 s, 0.0 kB/s
Does this mean I'm screwed?
In answering my own post yes it does. The disk although being reported to exist by lsscsi is not spinning up properly so the cost of getting any data back far out weighs what it worth to me. Thanks for your help folks.
cheers, BJ