Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How to solve Grub rescue and/or mounting hard drive problem

Writer Olivia Zamora

So, I have important files in this hard drive, and I need pick up them. To sum up, I had two HD on my machine: one with Ubuntu GNOME 14.04 and another two with Windows 7. I had to connect another HD with windows replacing the other one with windows, copy some files from this hard drive. After that, I connected only this HD and formatted it. Ok, no problem beyond a grub-rescue shell appearing, but I solved changing the boot order of the hard drives (no idea how).

Now, I need to pick up those files and place them into the windows hard driver, but again the grub-rescue shell. This time, I tried almost everything, mount it using a Live CD, some stuff in the grub-rescue, changing boot order, nothing. It's not even mounting it when I use windows or a live cd. In that first case, I hadn't a usb stick, but now I got one, I only want to mount the linux hard driver and copy those files.

Yes, I've searched for questions like this one here but didn't solved nothing...

So, here are some information and things I tried:

ubuntu@ubuntu:~$ sudo fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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 Disk identifier: 0x000285b2 Device Boot Start End Blocks Id System
ubuntu@ubuntu:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
sr0 11:0 1 2G 0 rom /cdrom
loop0 7:0 0 935.2M 1 loop /rofs
ubuntu@ubuntu:~$ blkid
/dev/sr0: LABEL="Ubuntu 14.04 LTS i386" TYPE="iso9660"
ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sda /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sda, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so

(this one I tried ext2, ext3, nothing changed)

ubuntu@ubuntu:~$ sudo fsck /dev/sda
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>

Then I tried:

ubuntu@ubuntu:~$ sudo e2fsck -b 8193 /dev/sda
e2fsck 1.42.9 (4-Feb-2014)
e2fsck: Bad magic number in super-block while trying to open /dev/sda
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>

And:

ubuntu@ubuntu:~$ sudo e2fsck -b 32768 /dev/sda
e2fsck 1.42.9 (4-Feb-2014)
e2fsck: Bad magic number in super-block while trying to open /dev/sda
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> or e2fsck -b 32768 <device>

I tried other things like:

ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt /dev/sda
Installing for i386-pc platform.
grub-install: error: failed to get canonical path of `/cow'.
ubuntu@ubuntu:~$ parted -l
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: Can't have a partition outside the disk! 

I tried too something in the grub-rescue shell, like:

grub-rescue> ls
(hd0)

Then I tried:

grub-rescue> ls (hd0)

And it said that the fylesystem is unknown, so I tried this (where n is any number between 1 and 8):

grub-rescue> ls (hd0,n)

Then I got there's not such partition, so I tried too:

grub-rescue> set prefix=(hd0)/boot/grub
grub-rescue> set root=(hd0)
grub-rescue> insmod (hd0)/boot/grub/i386-pc/linux.mod

Before I go on, I've stopped here because it says something about filesystem unknown (I tried too insmod (hd0)/boot/grub/linux.mod but didn't worked as well)

If I need solve this using windows I do can connect both hard drives and use the one with windows (puting it as priority at the BIOS).

Sorry if you don't understand something I said, I do not have a pretty good english... I tried to be as specific as possible... I really need those files, I was ready to format this hard drive, only finishing some stuff, I don't might if I loose the system, I just want those files.

Update:

I tried to mount the linux hard drive with Paragon ExtFS (a read and mount program for ext2, ext3, etc, hard driver) at Windows, but even there the HD wasn't mounting....

6

2 Answers

If the currrent fdisk -l output is literally just this:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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
Disk identifier: 0x000285b2 Device Boot Start End Blocks Id System

then you have somehow deleted your linux installation instead of the windows drive as you thought. This would be... unfortunate...

If you have a record of how the partitioning was set up, which is unlikely, then sometimes recreating the partitions will actually still have the disk data in place - but you have to be EXACT. If there was only one partition then it's worth a try of recreating a single, default linux (83) partition in fdisk & see if it contains data...

If not, then you need something like foremost, which is an undelete / file recovery tool that can scan your entire lost drive and copy files to a new drive - they will be un-named, and you will have loads of files, so this is going to keep you busy for some time. It will however sort them into types, which helps.

You may, of course, just have mixed up the drives - I suggest you check what's on the other two...

4

I was having a very simular issue when creating a bootable USB HDD. believe it or not, lots of forums and instructions only recommend ext4 because I suppose its the most widely used.

After many days of reading and experimenting on my flash drive, I noticed one thing while I was making a live USB drive, it was using ext2. SO, I decided to plug my USB HDD in and changed the partitioned from ext4 to ext2 and reload Ubuntu. expecting to see that pesky PCI and grub screen again I didn't get my hopes up but to my surprise ubunutu loaded right up and working still to this day! so with anyone having this issue i recommend using ext2 while making the proper portions while installing Ubuntu.

oh and I have a computer with no internal HDD just external.

0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy