# Could not mount the root filesystem as read / write - XFS

## Thaidog

I have run in to an issue where every time I boot Linux the system says:

"Could not mount the root filesystem as read / write

Give password for maintenance"

I give the password and try to run fsck.xfs (xfs root filesystem) which tells me to run xfs_check or xfs_repair to manage the filesystem. I do that and reboot... but it still keeps asking. I have 3 kereels to boot from and they all do the same thing. I tried booting with knoppix and running xfs_check and xfs_repair - no significant problems found. I cxan mount the filesystem from Nkoppxi and make changes, add files.. etc - but when I boot back to the Gentoo system it still gives the same error.

I heard something like this could be some kind of filesystem maintenance error since it has been a while since this system has been booted it could be that XFS has added a flag to check the filesystem... not sure why this would not be taken care of after after running xfs_check on Knoppix however.

----------

## notHerbert

Please post /etc/fstab and grub.conf

----------

## Thaidog

 *notHerbert wrote:*   

> Please post /etc/fstab and grub.conf

 

grub:

default 0 

timeout 30 

title=Gentoo Linux 2.6.22-r8 

root (hd0,0) kernel /boot/kernel-2.6.24-gentoo-r7 root=/dev/hda2 splash=silent,theme:livecd-2007.0 video=vesafb:1024x768-32@60 quiet CONSOLE=/dev/tty1 

initrd /boot/fbsplash-livecd-2007.0-1024x768 

fstab:

/dev/hda1   /boot        ext2    defaults,noatime     1 2

/dev/sda2   /         XFS    noatime                   0 1

/dev/sda3   none            swap    sw              0 0

/dev/cdrom  /mnt/cdrom   auto    noauto,user          0 0

----------

## notHerbert

Thanks Thaidog

Can you try this in grub

```
root (hd0,0) 

kernel /boot/kernel-2.6.24-gentoo-r7 root=/dev/hda2 ro

initrd /boot/fbsplash-livecd-2007.0-1024x768
```

Ya I know ro - that's the problem. Please try it. The jfs filesystem needs the ro statement in grub to run it's filesystem checks, perhaps all your grub options are what are interfering with xfs running it's filesystem checks, and maybe adding ro will compensate.

----------

## Ravak

In grub you define root as:

```
root=/dev/hda2
```

but in fstab you have:

```
/dev/sda2
```

Which is right?

----------

## notHerbert

Ravak

Good catch.

----------

## Thaidog

 *Ravak wrote:*   

> In grub you define root as:
> 
> ```
> root=/dev/hda2
> ```
> ...

 

Mistype - it's /dev/hda

----------

## Thaidog

 *notHerbert wrote:*   

> Thanks Thaidog
> 
> Can you try this in grub
> 
> ```
> ...

 

Ok I will try it.

----------

## ragzovskii

I have the same trouble.

fstab

```

/dev/BOOT      /boot      ext2      noauto,noatime   1 2

/dev/ROOT      /mnt/hdd3      ext3      noatime      0 1

/dev/SWAP      /mnt/hdd2      swap      sw      0 0

/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0 

```

grub.conf

```
default 1

timeout 30

splashimage=(hd1,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 2.6.25-r8

root (hd1,2)

kernel /boot/kernel-genkernel-x86-2.6.25-gentoo-r8 root=/dev/ram0 ro video=vesafb:mtrr:3,ywrap,1280x1024-32@70

init=/linuxrc ramdisk=8192 real_root=/dev/hdd3 udev

initrd /boot/initramfs-genkernel-x86-2.6.25-gentoo-r8 
```

I really haven't ideas. help me, pleaseLast edited by ragzovskii on Sat Nov 15, 2008 9:15 am; edited 1 time in total

----------

## bunder

Moved from Installing Gentoo to Kernel & Hardware.

----------

## djinnZ

is not an error 990 of xfs than require manual fix?

----------

## ragzovskii

according to my memories (and system messages) it's not a error 990: kernel says only "Could not mount the root filesystem as read / write 

Give password for maintenance"

this is the last challenge between me and workable Gentoo Linux  :Smile: 

----------

## Thaidog

I had to work around this one. What I did was a backup using xfs_dump to another hd. After that I reformatted the root filesystem with mkfs.xfs with the force option. After that I did an xfs_restore to the new filesystem and then the system booted up just fine. Still this was an annoying process for something that looks like xfs_check should be able to handle.

----------

