HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Bad magic number in super-block while trying to open /dev/sda2 (http://www.howtoforge.com/forums/showthread.php?t=29951)

kevinluu 2nd January 2009 20:55

Bad magic number in super-block while trying to open /dev/sda2
 
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_resi...xt3_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

falko 3rd January 2009 16:03

Can you post the output of
Code:

fdisk -l
?

kevinluu 5th January 2009 02:12

Bad magic number in super-block while trying to open /dev/sda2
 
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

falko 5th January 2009 10:52

/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

kevinluu 11th January 2009 01:53

Quote:

Originally Posted by falko (Post 162965)
/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

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

falko 11th January 2009 14:30

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

kevinluu 12th January 2009 08:32

Quote:

Originally Posted by falko (Post 164031)
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

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

kevinluu 23rd January 2009 06:36

Quote:

Originally Posted by kevinluu (Post 164135)
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


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

falko 24th January 2009 12:41

You could try this: https://answers.launchpad.net/ubuntu/+question/9120
but please back up your data before you try this!

kevinluu 26th January 2009 21:35

Quote:

Originally Posted by falko (Post 166007)
You could try this: https://answers.launchpad.net/ubuntu/+question/9120
but please back up your data before you try this!

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


All times are GMT +2. The time now is 06:42.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.