LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Knoppix sees hda instead of sda- can't recover (https://www.linuxquestions.org/questions/linux-newbie-8/knoppix-sees-hda-instead-of-sda-can%27t-recover-882319/)

circumbendibus 05-23-2011 02:31 PM

Knoppix sees hda instead of sda- can't recover
 
Well I thought I knew my way around a little, but apparently mounting is still a complete mystery to me. I'm trying to back up my data with Knoppix since Ubuntu won't start up. something weird is happening with the keyboard and it starts spamming ^[[26~ across the splash screen.

When I try to read my hard drive, Knoppix tells me "mount: wrong fstype, bad option, bad superblock." It seems like it should be a pretty common error, but I haven't found any anything helpful and understandable that doesn't involve rebooting (won't get me anywhere with Knoppix). I think it has something to do with Knoppix insisting my drive is hda instead of sda, though I have read that Ubuntu likes to tell you hda is sda anyway. Knoppix is the only distro that has worked on a live boot so far.

I've thought of trying dd, dd rescue, or just cp onto my external, but I don't know if Knoppix's hda business will make a working backup. The other computers around are all Windows with no extra space, so I don't know what the easiest and safest way is to test wether the back up worked.

Thanks! I know that was long.

rokytnji 05-23-2011 02:56 PM

Not sure if I can help. If just wanting to copy /home to a external drive. Open Knoppix file Manager as root. Then copy what you want backed up to external drive.

For me (SINCE I don't run Knoppix) I would use rox file manager for this. I would open 2 rox windows from terminal (as root user in terminal so rox would be running as root user also)

Find my external backup drive in /mnt or /media and open it. Open Ubuntu /home which should sit in /mnt. Then just drag and drop files from ubuntu /home to external drive and pick copy from window that opens.

For hda and sda erring/errors. I use bklid labeling in /etc/fstab. My post below

http://www.linuxquestions.org/questi...6/#post4331101

Edit: Knoppix documentation is kinda old but here goes any ways.

http://www.ibm.com/developerworks/li...opx/index.html

honeybadger 05-23-2011 03:06 PM

Looks like the OP is trying to mount the device but is not able to because of the fs type errors.
What I would suggest here is do a fsck -a -y /dev/hda<partition number> and try the mount command again.
fsck will repair the filesystem but then there is a chance that you may loose data but the chances are small.
Hope this helps.

jefro 05-23-2011 03:22 PM

Boot to some live cd of the same level and fix disk.

I have used knoppix to access the fsck or e2fsck on the hard drive it it worked. Don't use Knoppix's check.

syg00 05-23-2011 09:40 PM

The OP says this is the only liveCD that will boot - likely an old one if Knoppix still uses /dev/hda.
As per above, this is an error in the filesystem, not (strictly) with mount itself. You may have another problem if the liveCD doesn't support ext4 - which is probably the default these days on Ubuntu. Let's see the ouput of "parted -l /dev/hda" from teh liveCD.

The hda versus sda isn't generally a problem for backing up with imaging type tools - if "dd" (or whatever) can read it, the backup should be faithful. May not be any useable (as in mountable) if there are severe filesystem errors, but will be a copy of the source.
Once done, then try the fsck.

r3sistance 05-23-2011 11:06 PM

ok, I am gunna scratch my head and ask this... doesn't Ubuntu usually install itself from a live version of itself... so wouldn't that have worked? like Syg00 suggested. I am not sure if Knoppix supports ext4 what I believe Ubuntu uses these days and potentially why it doesn't understand the metadata in the superblock... I'd suggest trying a Ubuntu disk, it should give an option like "boot live" (been sometime since I have used ubuntu), this should allow easier maintenance.

jefro 05-24-2011 03:18 PM

No, he said ubuntu won't start up. He didn't say a live ubuntu disk failed.

syg00 05-24-2011 06:10 PM

Quote:

Originally Posted by circumbendibus (Post 4364919)
Knoppix is the only distro that has worked on a live boot so far.

Seems pretty obvious.

jefro 05-24-2011 07:38 PM

maybe, maybe not.

circumbendibus, could you please tell me if you did try a known good cd of the exact level distro you installed? Was it a live cd or install cd?

circumbendibus 06-01-2011 04:29 PM

Whoa! Sorry folks, nohing showed up like anyone had posted until now, and there were no email alerts. In order to catch up:

rokytnji: The whole problem is that it won't mount or read anything in the hard drive-- file manager won't work. I'll look into bklid, but I don't understand enough about the whole process to get why /etc/fstab is necessary when you're just telling it to mount manually.

SilverBack: You'd hope fsck would do the trick, but I don't follow the details, and it hasn't done anything so far. Maybe your options will be the magic ones; I'll come back with the errors.

jefro: What does it mean for a live disk to be the same level?

syg00: I'm on Lucid, but I'm pretty sure it's set up as ext3; I'll check. dd is exactly what I tried and made a .img file. Is that right? I can't figure out how to mount it or anything on my brother's machine (Live boot of Mint) so I could check if the backup was successful. How do I check the integrity of the backup?

I've tried different versions of several distros, including Lucid and Hardy. Only Knoppix even starts, but it still writes the weird ^[[26~ all over the screen first. In the Knoppix terminal, it occasionally goes crazy with a string of ~ or 9 or c (exclusive). Since that requires the Shift key to be both jammed and not jammed, jumping up and getting a new keyboard was not my first inclination. It is, however, an issue independent of software. My Knoppix copy is old-- 4.something. Any ideas why it works and nothing else? With Mint on a jump drive, it said "no operating system detected." I installed Ubuntu from the same drive, and the copy of Mint worked fine for my bro.

Thanks a bunch! Hope that gets us closer.

circumbendibus 06-01-2011 04:41 PM

In case you were wondering what happens when I boot Ubuntu (it's the same for the installed and the live), once it's done printing ^[[26~, it cycles between the splash screen and a different combination of the following lines each time I boot up.

fsck from util-linux-ng 2.17.2
/dev/sda1 has been mounted 26 times without being checked, check forced
/dev/sda1: clean, 329069/3588096 files, 7562/2432652
*Speech-dispatcher configured for user sessions
*Starting the Windbind daemon windbind

Maybe that says something about the fsck business. On occasion, especially if I mash some buttons, it cycles through a four page list of errors about not being able to show the splash screen. That doesn't seem that helpful, but I typed it up once, and I could throw it up on pastebin or somewhere. I was able to see because the scroll key is the only one that is responsive.

syg00 06-01-2011 10:47 PM

Hmmm - sounds like a hardware error to me. Or several. BIOS maybe ...
A liveCD/USBkey shouldn't attempt to mount the harddisk - looks like that isn't being recognised, and your disk install is still being booted. I'd disconnect the disk - just pull out the power plug will do. For a laptop, just pull out the disk. That'll prove if you can use the hardware/BIOS o.k.

I keep external housings so I can work on dodgy disks on other (known good) machines.
Did you "dd" the whole disk or just the partition of interest ?. If the latter you should be able to loop mount the dd image - "sudo mount -o loop /media/<USBkey>/a.img /mnt"
You might be able to do it from the GUI too, but I rarely use it.
It should fsck itself on mount. After that, there is no real way to verify the actual data is valid. But that applies to any disk you've ever used, so I wouldn't worry too much.

circumbendibus 06-02-2011 04:53 PM

All right, sudo fsck -a -y /dev/hda1 says you can only use on of -a,-n, or -y. Trying any of those tells me:

<Code>
e2fsck 1.40-WIP (14-Nov-2006)
fsck.ext3: Filesystem has unsupported feature(s) while trying to open /dev/hda1

The superblock could not be read or does not dexcribe 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>
<Code>

Trying what it says gives the same thing, but the second line is "e2fsck: Bad magic number in super-block while trying to open /dev/hda1".

Anyway, the BIOS and boot menus (F2 and F10) work fine, if that's what you're asking. Are you just saying to pull out the live disk? syg00, I tried your mount command, but I just get the same stupid error:

<Code>
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or other error
In some cases useful info is found in syslog - try dmesg | tail or so
<Code>

I just used $dd if=/dev/hda1 of=/media/sda1/lucid.img where sda1 is what it's calling my external hard drive. If it's a hardware issue, could I do something in the BIOS to get it to use a USB keyboard instead? None of the keyboards in the house seem to be USB, so maybe I should just go get the keyboard replaced? It's an old model, so I don't know how much of a pain it would be to get a new one in. Why can't I just pop my hard drive out and treat it like an external to some other machine? I just found out my PhD program will give us laptops, so I guess I'm OK letting this one go, but I really need some of the stuff on there.

Thanks

Karl Godt 06-02-2011 08:09 PM

Quote:

In some cases useful info is found in syslog - try dmesg | tail or so
Code:

dmesg | grep -i -E 'reiser|ext[2-4]|vfat|ntfs|hfs|jfs|xfs|hd|Mounted root|Kernel command line'
There must be also fsck.reiser *.xfs *.jfs . The modern kernels also can be configured with hda-drives , mine @moment is 2.6.37.4-KRG-p4_1 and
Code:

cat /proc/partitions
gives :
Code:

7        0    524288 loop0
  3      64  488386584 hdb
  3      65  10377958 hdb1
  3      66          1 hdb2
  3      67  10313730 hdb3
  3      68  14964547 hdb4
  3      69  15390270 hdb5
  3      70  15366141 hdb6
  3      71  15558921 hdb7
  3      72  15446466 hdb8
  3      73  247882918 hdb9
  3      74  15880221 hdb10
  3      75    8498353 hdb11
  3      76  114551451 hdb12
  3      77    1020064 hdb13
  3      78    1028128 hdb14
  3      79    1052226 hdb15
  3      80    1052226 hdb16
  8        0    1955840 sda
  8        1    1955406 sda1

and
Code:

ls -l /dev/hdb*
Code:

brw------- 1 root root 3, 64 2011-04-09 06:01 /dev/hdb
brw------- 1 root root 3, 65 2011-04-09 06:02 /dev/hdb1
brw-rw---- 1 root root 3, 74 2011-06-03 02:27 /dev/hdb10
brw-rw---- 1 root root 3, 75 2011-06-03 02:27 /dev/hdb11
brw-rw---- 1 root root 3, 76 2011-06-03 02:27 /dev/hdb12
brw------- 1 root root 3, 77 2011-04-09 06:02 /dev/hdb13
brw------- 1 root root 3, 78 2011-04-09 06:02 /dev/hdb14
brw------- 1 root root 3, 79 2011-04-09 06:02 /dev/hdb15
brw------- 1 root root 3, 80 2011-04-09 06:02 /dev/hdb16
brw-rw---- 1 root root 3, 66 2011-06-03 02:27 /dev/hdb2
brw------- 1 root root 3, 67 2011-04-09 06:02 /dev/hdb3
brw-rw---- 1 root root 3, 68 2011-06-03 02:27 /dev/hdb4
brw-rw---- 1 root root 3, 69 2011-06-03 02:27 /dev/hdb5
brw-rw---- 1 root root 3, 70 2011-06-03 02:27 /dev/hdb6
brw------- 1 root root 3, 71 2011-04-09 06:02 /dev/hdb7
brw-rw---- 1 root root 3, 72 2011-06-03 02:27 /dev/hdb8
brw-rw---- 1 root root 3, 73 2011-06-03 02:27 /dev/hdb9

It seems , that if the Maj Min of /dev and /proc/partitions don't match the ones in /proc/partitions are the ones to use . I also get similar mount errors if I had booted a 259-Maj kernel that left its /dev/nodes and next time booting a sda Maj8 or hdb Maj3|22 kernel .

Karl Godt 06-02-2011 08:28 PM

And for the superblock issue :
Code:

dumpe2fs /dev/hdb1 | grep -i backup
Code:

Backup superblock at 32768, Group descriptors at 32769-32769
  Backup superblock at 98304, Group descriptors at 98305-98305
  Backup superblock at 163840, Group descriptors at 163841-163841
  Backup superblock at 229376, Group descriptors at 229377-229377
  Backup superblock at 294912, Group descriptors at 294913-294913
  Backup superblock at 819200, Group descriptors at 819201-819201
  Backup superblock at 884736, Group descriptors at 884737-884737
  Backup superblock at 1605632, Group descriptors at 1605633-1605633

Code:

e2fsck -b 32768 /dev/hdb1
or
Code:

SBBUPS=`dumpe2fs /dev/hdb1 | grep -i backup |sed 's#^ *##g' | cut -f 4 -d ' ' | tr -d ','`
for i in $SBBUPS ; do
fsck -b $i /dev/hdb1
done



All times are GMT -5. The time now is 09:30 PM.