Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
A customer of mine loaded his entire music collection (200+GB) on a Maxtor external drive/network attached storage device. After he moved all the files over, the device stopped responding, with the only copy of his music stranded on it. The NAS was Linux based, so the drive was in ext3 format. He hired me to recover it.
The NAS was no longer under warranty, so I took out the hard drive and put it in an external USB hard drive enclosure. I installed OpenSUSE 11 on an old Pentium 3 PC, and was able to get in and find his files. My customer had another network attached storage box, a buffalo Terastation, that he wanted his music collection transferred to.
Here's where it all went wrong:
I only recently started using Linux, and after spending all morning trying and failing to get the OpenSuse machine to see the terastation on the local network with Samba, I decided to try things from the other side and installed a program called Ext2 IFS 1.11 on my windows XP laptop that in theory would allow it to read ext2 and ext3 partitions.
When it didn't work, I took my USB enclosure back over to the Linux machine. This time I couldn't get dolphin to mount any of the four partitions on the hard drive. I rebooted, and afterward I was able to get into 3 of the partitions, but the last one (the one with the music collection on it) gave me the following error code when I tried to access it:
"an error occurred while accessing 'Volume (ext3)' the system said: org.freedesktop.hal.device.volume.unknownfailure: mount: wrong fs type, bad option, bad superblock on /dev/sdc6, missing codepage or helper program, or other error"
Occasionally when I unmount, disconnect and reconnect the hard drive the partition will be accessible, it appears empty, but the free space indicates that it's half full.
I tried connecting the hard drive to another machine also running Opensuse 11, and got the same error message and weird behavior.
Is there anything that I can use to recover the partition?
Thanks in advance
-DLH
Last edited by DarwinsLittleHelper; 06-26-2009 at 06:14 PM.
I would try mounting the partition manually from the terminal instead of using a GUI program. The feedback might be more instructive. Open up another terminal and run "sudo tail -f /var/log/messages". This will follow the kernel messages. If you try to mount a partition, and it fails there should be a kernel message printed. That may provide more information.
In the first terminal, try "sudo mount -t ext3 /dev/sdc6 /mnt/ -o ro"
There is a program "fsck.ext3" that you can use to repair the ext3 filesystem.
Use it when the partition is not mounted, which I guess will be no problem!
"sudo -n /sbin/fsck.ext3 /dev/sdc6" will run a check but not make any changes.
"sudo -p /sbin/fsck.ext3 /dev/sdc6" will run a check and repair items automatically that can be done safely without intervention.
"sudo -y /sbin/fsck.ext3 /dev/sdc6" will run a check and assume a "y" response to all questions.
Your best bet may be the -p option.
Please scan through the manpages for "fsck.ext3" and "mount".
There are some other options you may need. For example, if the superblock is bad, you can try using a backup instead when running fsck.ext3.
jschiwal,
I tried sudo -p /sbin/fsck.ext3 /dev/sdc6, it ran for a few minutes, then ended with this error:
sudo: pam_authenticate: Conversation error
The tail information is as follows:
Jun 26 21:30:16 linux-e4lg sudo: pam_unix2(sudo:auth): conversation failed
Jun 26 21:30:16 linux-e4lg sudo: chris : pam_authenticate: Conversation error ; TTY=pts/2 ; PWD=/home/chris ; USER=root ; COMMAND=/dev/sdc6
yancek,
I've downloaded and burned SystemRescueCD, thanks for the recommendation, I'm a little bit nervous about running the software until I know a little bit more about what the problem is, but I may use it.
Last edited by DarwinsLittleHelper; 06-26-2009 at 08:55 PM.
I'm not quite sure why the sudo -p suggestion (just because I've never used it), but I'd simply try su'ing to the root account and trying fsck form there, so
su -
<enter root password>
/sbin/fsck.ext3 /dev/sdc6
since it looks like an authentication issue rather than a fsck issue.
I may be wrong here in that Suse changed their root policy IIRC.
I tried SU'ing into the root account. It seems to have gotten past the authentication issue, but it threw up another error message:
"linux-e4lg:~ # /sbin/fsck.ext3 /dev/sdc6
e2fsck 1.40.8 (13-Mar-2008)
/sbin/fsck.ext3: Superblock invalid, trying backup blocks...
/sbin/fsck.ext3: Bad magic number in super-block while trying to open /dev/sdc6
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>"
linux-e4lg:~ # e2fsck -b 8193 /dev/sdc6
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: No such file or directory while trying to open /dev/sdc6
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>
It mentions an alternate superblock. Can I use any number or does it have to be specific?
Thanks for the help so far by the way, I would have never gotten this far on my own.
On my Fedora system there are distinct fsck tools available:
$ ls /sbin/fsck*
/sbin/fsck /sbin/fsck.cramfs /sbin/fsck.ext2 /sbin/fsck.ext3 /sbin/fsck.ext4 /sbin/fsck.ext4dev /sbin/fsck.msdos /sbin/fsck.vfat
Some of these are symlinks (/sbin/fsck.msdos -> dosfsck and /sbin/fsck.vfat -> dosfsck)
-b superblock
Instead of using the normal superblock, use an alternative superblock specified by superblock. This option is
normally used when the primary superblock has been corrupted. The location of the backup superblock is depen-
dent on the filesystem's blocksize. For filesystems with 1k blocksizes, a backup superblock can be found at
block 8193; for filesystems with 2k blocksizes, at block 16384; and for 4k blocksizes, at block 32768.
Additional backup superblocks can be determined by using the mke2fs program using the -n option to print out
where the superblocks were created. The -b option to mke2fs, which specifies blocksize of the filesystem must
be specified in order for the superblock locations that are printed out to be accurate.
If an alternative superblock is specified and the filesystem is not opened read-only, e2fsck will make sure that
the primary superblock is updated appropriately upon completion of the filesystem check.
Ok, so I've read up on e2fsck and mke2fs -n. I managed to find a list of alternate superblocks, and after trying a few with e2fsck, I found one that appears to work, it didnt give me an error message at the least.
I entered e2fsck -b 163840 -p dev\sdc6\ and got a new line that only displayed ">"
When I highlighted the command above to copy it, I pressed ctrl+c out of habit, and it brought back the normal prompt.
I re-ran e2fsck along with sudo tail -f /var/log/messages, but it doesn't show anything happening. is there anything it's expecting me to enter at the >?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.