Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Bad Magic Number in super-block while trying to open /dev/sda2

  1. #1
    Join Date
    Oct 2006
    Location
    Australian wine country!
    Beans
    542
    Distro
    Ubuntu Development Release

    Bad Magic Number in super-block while trying to open /dev/sda2

    I have stuffed up I think.

    I used GPartEd to create an extended partition to allow me to use more primary partitions to try other distros. All went well until I tried to reboot,this is where I get the error; "Bad Magic Number in super-block while trying to open /dev/sda2"

    My / partition is sda1 and home partition is now renamed by GPartEd to sda5. sda2 as referred to in the error message is actaully the swap partition.

    Simple request ..... what do I do?


    tony
    Last edited by tchoklat; November 6th, 2008 at 07:03 AM.
    "Frankly Bill ... I don't give a damn!"
    Linux User # 434139
    Using Ubuntu 10.10 on my eeepc and loving it!!

  2. #2
    Join Date
    Jul 2007
    Location
    Melbourne, Australia
    Beans
    3,475
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Please post the output of
    sudo fdisk -lu
    Windows is the best virus detector on the market!
    Ubuntu attracts Human Beings - Windows attracts viruses and worms

  3. #3
    Join Date
    Oct 2006
    Location
    Australian wine country!
    Beans
    542
    Distro
    Ubuntu Development Release

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Quote Originally Posted by bumanie View Post
    Please post the output of
    from the Ubuntu liveCD!

    ubuntu@ubuntu:~$ sudo fdisk -lu

    Disk /dev/sda: 320.0 GB, 320071851520 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625140335 sectors
    Units = sectors of 1 * 512 = 512 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 63 85112369 42556153+ 83 Linux
    /dev/sda4 85112370 620815859 267851745 5 Extended
    /dev/sda5 243738180 361205459 58733640 83 Linux
    /dev/sda6 361205523 463764419 51279448+ 7 HPFS/NTFS
    /dev/sda7 85112496 161887004 38387254+ 83 Linux
    /dev/sda8 161887068 243738179 40925556 83 Linux
    /dev/sda9 463764483 620815859 78525688+ 83 Linux

    Partition table entries are not in disk order
    ubuntu@ubuntu:~$


    sd 1 is /
    sd 5 is /home
    sd 6 is the virus
    I have deleted sd2 which was swap!
    the others are the extended partition and the empty ext3 partitions I wanted to try other distros on.


    Tony
    Last edited by tchoklat; November 6th, 2008 at 08:47 AM.
    "Frankly Bill ... I don't give a damn!"
    Linux User # 434139
    Using Ubuntu 10.10 on my eeepc and loving it!!

  4. #4
    Join Date
    Jul 2007
    Location
    Melbourne, Australia
    Beans
    3,475
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    A bad magic number is not a good sign, as you probably realize. Here are a couple of pages with suggestions how you may be able to recover things, but it looks difficult and any attempted fix may make things worse. Read the following and post back with questions - someone may be able to help, but it looks it could be a hardware issue, but there is one mention about changing partitions causing the problem. I would be tempted to use something like testdisk to try and rewrite the disk back to how it was before you used gparted - but if you make a mistake with testdisk, you will probably make things worse. Do you have large enough external hard drive (or separate internal) to copy your hard drive to? Trying to fix these things can be difficult. Alternatively, you could copy important data via the live cd and reinstall. If you did that, place windows on the first partition - it doesn't behave well in logical partitions, but linux will operate fine from a logical partition. If you try testdisk, read the documentation well before using it - also look here.
    Windows is the best virus detector on the market!
    Ubuntu attracts Human Beings - Windows attracts viruses and worms

  5. #5
    Join Date
    Oct 2006
    Location
    Australian wine country!
    Beans
    542
    Distro
    Ubuntu Development Release

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Quote Originally Posted by bumanie View Post
    A bad magic number is not a good sign, as you probably realize. Here are a couple of pages with suggestions how you may be able to recover things, but it looks difficult and any attempted fix may make things worse. Read the following and post back with questions - someone may be able to help, but it looks it could be a hardware issue, but there is one mention about changing partitions causing the problem. I would be tempted to use something like testdisk to try and rewrite the disk back to how it was before you used gparted - but if you make a mistake with testdisk, you will probably make things worse. Do you have large enough external hard drive (or separate internal) to copy your hard drive to? Trying to fix these things can be difficult. Alternatively, you could copy important data via the live cd and reinstall. If you did that, place windows on the first partition - it doesn't behave well in logical partitions, but linux will operate fine from a logical partition. If you try testdisk, read the documentation well before using it - also look here.

    Hmmmm! If I copy the data from / and from /home to an external HDD, will I be able to copy it back after reformatting and partitioning the HDD? If so what commands do I use. I really need my /home partition, would like my / partition and can live without the ntfs partition?

    I am unable to mount the partitions using the liveCD, I get
    error: device /dev/sda7 is not removable
    error: could not execute pmount


    Your assistance is magic!

    regards


    Tony
    Last edited by tchoklat; November 6th, 2008 at 09:26 AM.
    "Frankly Bill ... I don't give a damn!"
    Linux User # 434139
    Using Ubuntu 10.10 on my eeepc and loving it!!

  6. #6
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Did you update your "fstab" after the partitioning? Post the output of


    Code:
    sudo mount /dev/sda1 /mnt
    sudo blkid
    cat /mnt/etc/fstab

  7. #7
    Join Date
    Oct 2006
    Location
    Australian wine country!
    Beans
    542
    Distro
    Ubuntu Development Release

    FIXED -- Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Quote Originally Posted by meierfra. View Post
    Did you update your "fstab" after the partitioning? Post the output of


    Code:
    sudo mount /dev/sda1 /mnt
    sudo blkid
    cat /mnt/etc/fstab

    Think you got it right. FStab was not correctly idintifying the partitions, it did not appear to have changed when I amended the partitions. I always thought that GPartEd did this, I was wrong, at least in this instance.

    I have reconstructed a new install and all is well now, thanks!


    Tchoklat
    "Frankly Bill ... I don't give a damn!"
    Linux User # 434139
    Using Ubuntu 10.10 on my eeepc and loving it!!

  8. #8
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    I always thought that GPartEd did this
    Nope, GpartedEd does not edit fstab.

    Glad you got it to work.

  9. #9
    Join Date
    Jan 2009
    Beans
    6

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Quote Originally Posted by meierfra. View Post
    Nope, GpartedEd does not edit fstab.

    Glad you got it to work.

    Dear Bumanie, meierfra and tchoklat:

    My name is Kevin.

    I am very new to Linux.

    I need help from you all to show me how can i fix the same problem "Bad magic number in super-block while trying to open /dev/sda2" i just encounter after i resize my /dev/sda2 partition.

    On my system the command: fdisk -lu

    Disk /dev/sda:500.1GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

    Units = sectors of 1* 512 =512 bytes

    Device Boot Start End Blocks Id System

    /dev/sda1 * 63 208844 104391 83 Linux
    /dev/sda2 208845 976768064 488279610 83 Linux


    Would you please show me:

    Where can i find the "fstab" that meierfra mentioned and how must i update this fstab using infomation disaplyed from the fdisk -lu command?

    Thank you very much.

    Kevin

  10. #10
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Bad Magic Number in super-block while trying to open /dev/sda2

    Please post the output to the commands
    Code:
    sudo mount /dev/sda2 /mnt
    sudo blkid
    cat /mnt/etc/fstab
    Given that info, we should be able to set you right.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •