Bad magic number in super-block while trying to open /dev/sda2

Discussion in 'HOWTO-Related Questions' started by kevinluu, Jan 2, 2009.

  1. kevinluu

    kevinluu New Member

    Dear Mr. Falko,

    First of all, i would like to thank you for the steps on "How To Resize ext3 Partitions Without Losing Data" that you post on the web-site.

    I am very very new to Linux.

    After cloning the original disk 250GB (/dev/sda2 in this disk has about 224GB) to a new 500GB disk, i then re-partition the /dev/sda2 to have about 490GB.

    I then following the steps that show how to "Enlarging An ext3 Partition" from this link:


    http://www.howtoforge.com/linux_resizing_ext3_partitions


    One of these steps ask me to enter the command: fsck -n /dev/sda2
    i got the error message as shown below:

    "
    ...
    ...
    fsck.ext2: Bad magic number in super-block while trying to open /dev/sda2
    ...
    ...
    "


    However, if i enter command: fsck -n /dev/sda1
    i got:

    "
    ...
    ...
    /boot: clean, 36/26104 files, 17488/104388 blocks
    "

    The comand : tune2fs -o^has_journal /dev/sda2
    also shows error:

    "
    ...
    Bad magic number in super-block while trying to open /dev/sda2
    Couldn't find valid filesystem superblock.
    "



    The /dev/sda2 in this new 500GB is the filesystem that i need to enlarge so that it can use the rest of the available space in this /dev/sda2 partition.

    The "fdisk -l" command shows that the /dev/sda2 has about 490GB.

    But when i do the "df -h" command shows that:

    /dev/mapper/VolGroup00-LogVol00 (for some reason the original person who set up this system made the /dev/sda2 mapped to this /dev/mapper/VolGroup00-LogVol00) is about 224GB.

    I was trying to follow the steps so that i can use the resize2fs command in the steps to enlarge the /dev/sda2 filesystem to have 490GB.



    Would you please show me how can i fix this error:

    "Bad magic number in super-block while trying to open /dev/sda2"

    in my /dev/sda2 so that i can continue to follows the steps to successfully enlarge my /dev/sda2 to have 490GB.

    Thank you very much.

    Kevin
     
  2. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Can you post the output of
    Code:
    fdisk -l
    ?
     
  3. kevinluu

    kevinluu New Member

    Dear Mr. Falko,

    The "fdisk -l" command gives the below message;

    Disk /dev/sda: 500.1GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 60801 488279610 8e Linux LVM

    Thank you very much.

    Kevin
     
  4. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    /dev/sda2 is an LVM partition. The tutorial doesn't work with LVM partitions. For resizing LVM partitions, take a look at this tutorial: http://www.howtoforge.com/linux_lvm
     
  5. kevinluu

    kevinluu New Member

    Dear Mr. Falko,

    The tutorial in the URL below

    http://www.howtoforge.com/linux_lvm

    uses linux commands: pvcreate, pvdisplay, vgdisplay,....,lvcreate, lvdisplay, lvscan etc.

    In my system (Fedora 4) I could not find these commands at all.

    After i switched "su" super user account, i then entered any vg/lv/pv command mentioned in the tutorial. i got the error message as shown below:

    bash: pvdisplay: command not found

    or

    bash: lvscan: command not found

    etc.

    However, I can access df, fdisk, ls command etc. without any problem.

    Please let me know where are these vg/lv/pv commands are?

    What should i do before i can access and use these vg/lv/pv command to follow your tutorial?

    Please help.

    Thank you very much.

    Kevin
     
  6. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Please log in as root directly (without "su"). The PATH variable is then different, and you should find the commands. If not, please post the output of
    Code:
    ls /sbin
     
  7. kevinluu

    kevinluu New Member

    Dear Mr. Falko,

    Yesterday, i used the "su" command, i could NOT access those lv.../vg.../pv... etc. commands.

    Today, after the "su -" command, i can access those lv.../vg.../pv... etc. commands mentioned in your tutorial.

    I will try your tutorial this coming weekend.

    Thank you very much.

    Kevin
     
  8. kevinluu

    kevinluu New Member


    Dear Mr. falko,

    I am very sorry for this long delay.

    I did the below command OK.

    lvextend -L460G /dev/VolGroup00/LogVol00

    However when i enter the below command

    e2fsck -f /dev/VolGroup/LogVol00

    I got the same "Bad Magic Number in super-block ....." as before.


    Below is my fstab:

    # This file is edited by fstab-sync - see 'man fstab-sync' for details
    /dev/VolGroup00/LogVol00 / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    /dev/devpts /dev/pts devpts gid=5,mode=620 0 0
    /dev/shm /dev/shm tmpfs defaults 0 0
    /dev/proc /proc proc defaults 0 0
    /dev/sys /sys sysfs defaults 0 0
    /dev/VolGroup00/LogVol01 swap swap defaults 0 0
    #/dev/sdb1 /mnt/windows ntfs ro,umask=0222 0 0


    Please help.

    Thank you very much.

    Kevin
     
    Last edited: Jan 23, 2009
  9. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

  10. kevinluu

    kevinluu New Member

    Dear Mr.Falko.

    I followed the link you gave then did the below command:

    mke2fs -n -S /dev/sda2

    The output contains some superblock backup stored on blocks:

    32768, 98304 etc.

    i then tried:

    e2fsck -b ###### /dev/sda2

    where ###### is one of these number but i still got Bad magic number output. I did tried all of these numbers.

    What should i try next.

    Thank very much.

    Kevin
     
  11. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Try the commands with /dev/VolGroup/LogVol00 instead of /dev/sda2.
     
  12. kevinluu

    kevinluu New Member

  13. kevinluu

    kevinluu New Member



    Dear Falko,

    I think i tried the commands with both /dev/VolGroup00/LogVol00 and /dev/sda2.

    I will try again.

    Thank you very much.

    Kevin
     
  14. Madoness

    Madoness New Member

    Thanks man... your info helped me with the same kind of situation. I know my harddrive is about to die soon enough.... but still.... your information made it work....

    Seems I hadn't had a clean unmounting causing this problem.:confused:
     

Share This Page