LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Checking root filesystem fails : No such file or directory while opening /dev/hda2 (https://www.linuxquestions.org/questions/linux-newbie-8/checking-root-filesystem-fails-no-such-file-or-directory-while-opening-dev-hda2-4175439963/)

ujjwalKumar 12-04-2012 06:09 AM

Checking root filesystem fails : No such file or directory while opening /dev/hda2
 
hi all,

I am running a CentOS base VM on top of Hyper-V server.
When i added SCSI controller(earlier it was ide controller) support with new kernel and install them in VM after reboot, i am hitting following filesystem check
error messages :
******************************************************
Setting hostname hostname:
Checking root filesystem
fsck.ext3/dev/hda2:
The superblock could not be read or does not describe 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>

: No such file or directory while trying to open /dev/hda2

*** An error occurred during the filesystem check.
*** Dropping you to a shell; the system will reboot
*** When you leave the shell.

*****************************************************
Also, when I go to the repair filesystem mode. I found out the strange behaviour when i ran those command :

****************************************
(Repair filesytem) 1 # mount
/dev/hda2 on / type ext3 (rw)
proc on /proc type proc (rw)

(Repair filesystem) 1# cat /etc/mtab
/dev/hda2 /ext3 rw 0 0
proc /proc proc rw 0 0

(Repair filesystem) 1# df
Filesystem 1K-blocks used Available Use% Mountedon
/dev/hda2 4%

******************************************
I thin for all above command there should be /dev/sda2 instead of /dev/hda2.

Also my fstab , and fdisk -l looks like ok for me.
*******************************************
(Repair filesystem) 1# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=swap-xvda3 swap swap defults 0 0

(Repair filesystem) 1# fdisk -l
Device Boot Start End Block Id System
/dev/sda1 * 1 49 98535 83 Linux
Partition 1 does not end with cylinder boundary.
/dev/sda2 49 19197 39062500 83 Linux
Partition 2 does not end with cylinder boundary.
/dev/sda3 ......
Partition 3 does not ......
/dev/sda4 ......
Partition 4 does not end ....

(Repair filesystem) 1# e2label /dev/sda1
/boot

(Repair filesystem) 1# e2label /dev/sda2
/

(Repair fielsystem) 1# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sda4

(Repair filesyatem) 1# ls /dev/hd*
ls: /dev/hd*: No such file or directory


Kindly suggest any configuration or kernel configs missing or how to solve this issues

Many many thanks for your reply. Please ignore any spelling mistakes because it is hand written.

thanks & Regards,
Ujjwal

fatmac 12-04-2012 01:46 PM

Just reading through your post, & I think maybe you are right about using sd as against hd, because sd used to stand for scsi disk, (hd = hard drive/internal ide). Also as fdisk -l is showing sda, & listing /dev is only showing sda partitions. fsck can't check hda2 as it doesn't exist.
I think your problem came about because you changed an IDE controller to a SCSI controller. Make sure you have good backups of your data before doing anything.

ujjwalKumar 12-04-2012 01:54 PM

fatmac,
thanks for your reply, I have taken a backup. But still i don't understand why this is happening and searching for reliable solution...

TKH 12-04-2012 10:17 PM

is there any kernel module missing?

ujjwalKumar 12-05-2012 03:05 AM

TKH,
I don't think or atleast i am not able to figure it out. Can you please suggest some configs or modules so that i can cross check?

markush 12-05-2012 03:37 AM

Could you please in more detail describe what you did. I understand that you have a VM with Centos running on Hyper-V. Then you added a scsi drive to the host.

When you executed the fsck.ext3 command, how did you know that the parition is formatted with ext3? is it possible that it in fact has another filesystem?

Markus

ujjwalKumar 12-05-2012 04:13 AM

markush,

When VM reboots and coming with new kernel, after starting udev , setting clocksource and setting hostname it checks the filesystem there it invokes the fsck.ext3 command and go further for enabling swap space , sysstat and all that.

Below are the my kernel File Systems config:
#
# File systems
#
# CONFIG_EXT2_FS is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
# CONFIG_EXT4_FS is not set

Also, i am sure, it is in same filesystem.

-ujjwal

ujjwalKumar 12-23-2012 11:18 PM

hi all,

(Repair filesystem) 1 # mount /
mount: /dev/sda2 already mounted or /busy
mount: according to mtab, /dev/hda2 is already mounted on /

can anybody suggest why it is?

-ujjwal

markush 12-24-2012 02:12 AM

What's the problem? fsck can only work on unmounted partitions. You have mounted / already (which is /dev/sda2 and so it can't be checked.

If you want to check your root filesystem you'll have to tell fsck to do it at boottime when it isn't already mounted.

Markus

ujjwalKumar 12-24-2012 05:28 AM

hi markush,

I am worried about this line "mount: according to mtab, /dev/hda2 is already mounted on /" because there is no such device named as /dev/hda2 then from where mtab storing /dev/hda2.

-ujjwal

markush 12-24-2012 05:32 AM

Could you please post your /etc/fstab file?

Markus

ujjwalKumar 12-24-2012 10:41 AM

I posted in first comment itself and posting again,

root@ujjwal# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=swap-xvda3 swap swap defults 0 0

ujjwalKumar 12-26-2012 03:29 AM

Also i like to add when I restart VM forcibly(means unclean shutdown/restart) and switch the kernel then this issue does not hit means system is coming up.
Any comment?


All times are GMT -5. The time now is 08:11 PM.