Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Edit: Sorry, I don't know how I broke text wrapping in this post.
Hello everyone! I just installed Xbuntu on a desktop I was given, and I'm having a disturbing issue. I have two 160GiB segate IDE hard drives installed, and the secondary one is giving me a Bad magic number error whenever I start my computer. I had initially formatted it with NTFS in windows, then formatted it to ext3 with GParted. This is the error I get:
Code:
Log of fsck -C3 -R -A -a
Sun Jun 29 21:41:41 2008
fsck 1.40.8 (13-Mar-2008)
fsck.ext3: Bad magic number in super-block while trying to open /dev/sdb
/dev/sdb:
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>
fsck died with exit status 8
Sun Jun 29 21:41:41 2008
----------------
It then brings up a repair terminal that I have no idea how to use. I get another error (with a big red [FAIL] beside it) after hitting ctrl+d to exit the terminal, but it scrolls too fast for me to see it. I followed the directions in the log, and got this:
Code:
david@david-xbuntu:~$ e2fsck -b 8193 sdb1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: No such file or directory while trying to open sdb1
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>
I have tried deleting the partition and reformatting the hard drive with GParted, as well as unmounting and repairing it too, but no luck.
If anyone can help me out with this, I'd really appreciate it. I've posted all the info below that I found in similar posts. Thanks!
Distro and kernel: Xbuntu 8.04, kernel 2.6.24-19-generic
fdisk -l
Code:
david@david-xbuntu:~$ sudo fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd99def38
Device Boot Start End Blocks Id System
/dev/sda1 * 1 19293 154970991 83 Linux
/dev/sda2 19294 19457 1317330 5 Extended
/dev/sda5 19294 19457 1317298+ 82 Linux swap / Solaris
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd99cbb6d
Device Boot Start End Blocks Id System
/dev/sdb1 1 19457 156288321 83 Linux
Anything important on the partition?
If not, make a new one with fdisk and do mkfs.ext3.
I had issues with gparted in the past, haven't used it since then.
dd976: how about checking again with what was suggested in the error-message, using an alternate superblock
e2fsck -b 8193 <device>
You could use dd to get the contents off the disc and into an image - if you have room to spare for that on another disk.
Then mount the image and copy your files back - after you fixed the disk by doing what r00tb33r said.
I'll give the superblock thing another go after work tonight, but I tried the fdisk and mkfs.ext3 method already, and am still getting the same error.
Also, my drives are IDE, and I don't have a single SATA drive. Is that odd? Most of the walktrhoughs I've seen concerning this kind of issue lable the hard drives as hd*. Is the fact that they're showing up as SCSI part of the problem?
Finally, I did an e2fsck -c -c -v to see if I could find corruption, and this is what came up:
Code:
david@david-xbuntu:~$ sudo e2fsck -c -c -v /dev/sdb1
[sudo] password for david:
e2fsck 1.40.8 (13-Mar-2008)
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: done
/dev/sdb1: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
11 inodes used (0.00%)
1 non-contiguous inode (9.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
355977 blocks used (0.91%)
0 bad blocks
1 large file
0 regular files
2 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
2 files
Well... That is kind of odd. It's been ages since I've encountered a SiS chipset...
The symptoms are interesting indeed. You didn't specify what output mkfs gave you. I assume that fdisk works fine deleting/creating partition boundaries.
jomen: Alright, just got home, and tried the e2fsck command:
Code:
david@david-xbuntu:~$ sudo e2fsck -b 8193 /dev/sdb
[sudo] password for david:
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdb
Filesystem mounted or opened exclusively by another program?
david@david-xbuntu:~$ sudo e2fsck -b 8193 /dev/sdb1
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sdb1
Filesystem mounted or opened exclusively by another program?
Heh, and ya, this is a really old compaq (sr1511nx) that I'm getting for between $200 and nothing. I even have a trackball mouse for it XD. Not surprised it's not very common, but it should hold my library of mp3s, pdfs, ect. I can store stuff I don't want on my less secure windows box, and generally get to learn linux. I know I have a long, long way to go.
If that last sentence means that there is nothing on the disk I'd take that out of /etc/fstab - so it does not get (tried to) mounted next time you boot.
Then I'd try the checking again - or even do not bother but making a new filesystem right away - and do a read/write test on it.
I cannot explain however that IDE-disks are showing up as with names wich only SATA/SCSI should have...
If you need to copy data, but still cannot mount the disk - use dd and see if you can read it off the resulting image.
You should perform any maintenance on your drives as a 'single' user. You can either boot a livecd or pass the 'single' parameter to your kernel at boot. Then you can safely perform your disk maintenance.
Alright, I think in the end it was a bad hd. I swapped it today for another one, and after setting everything up with the live cd, it works great. Thanks for all the help everyone, this was a great learning experience for me! One last question though: this is correct syntax for fstab to get this partition to check and mount on boot, right?
Yes this is correct - though I would not use /media as a mount point.
That is used by things like hal/udev to attach devices automatically as they are plugged in. /mnt/hd2 - or any other place - would be better IMO.
See man tune2fs - the "-i" or "-c" options too.
The defaults are quite low (30?) - after that many mounts/that time a check will be forced no matter what.
ps: could you please make sure that while you copy/paste like above you do not paste a lot of spaces along with the words you wanted - that makes the line very long and the whole post difficult to read, because you have to scroll horizontally...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.