fs errors root mount RO, how to mount RW without rebooting?
Not sure which forum this belongs in. A few choices for it, so I put it here. I hope its the best place.
I have a pair of 4.3GB SCSI disk as the root FS in my server. I sometimes get errors or one of them dropping out of the RAID 1 they are in. I have ran physical manufacture checks on them and they have passed. So right now, after the most recent case of re-adding one of the disks, I have found the fs to be mounted read-only. Although mount says its rw. I have a nice 140 day uptime, so dont want to have to reboot to re-mount this FS. I managed to run fsck on it while it was mounted and it fixed a few errors. See notes below: Code:
root@server:~# mount -o remount,rw / Code:
root@server:~# fsck /dev/mapper/mainsystem-slash Code:
root@server:~# mount -l | grep slash |
Depending on how your raid1 is setup, you should be able to pull out one disk at a time from the mirror and fix it. I wouldn't recommend running fsck on / if it's mounted. It's caused headaches for me in the past.
If you need help with the pulling the disks (not physically) out of the mirror and all that, can you post some spec's on what mirroring system/software you're using? Assuming lvm, but maybe not. Best wishes, Mike |
Thanks eggixyz
Lots of good info there. I didn't think fsck on a mount fs was a good idea, but sorta desperate haha. Makes perfect sense to pull one volumne out at a time and run fsck on it. What I have is software RAID 1 and then LVM on top of that. Code:
root@server:~# cat /etc/mdadm/mdadm.conf Code:
root@server:~# pvdisplay Code:
root@server:~# vgdisplay mainsystem Code:
root@server:~# lvdisplay mainsystem Code:
root@server:~# mount | grep [ts][ml][pa] | grep mapper I'll pull out /dev/sda2 and try fsck on it and then /dev/sdb2 and do the same. How do I then tell the system "the raid is ok, mount it as rw" ? |
AHHH!!
Code:
root@server:~# mdadm /dev/md1 -f /dev/sda2 |
Hey There,
Thanks for the info. More than I needed, but I never complain about that :) Once you're done fixing both disks, you can just run mount -o remount,rw / If this doesn't work try using the n option, also, so the mount doesn't try writing to the mnttab. Sometimes the write to mnttab fails and can make the mount fail even though it should be all right. mount -no remount,rw / or mount -n -o remount,rw / Since you have / listed in /etc/fstab you shouldn't have to define the device in your mount command. Best wishes :) , Mike |
Yeah mounting doesn't work as the FS has issues and is read-only. I need to work out a way to fix this FS without rebooting. Might have to bite the bullet and re-boot :(
|
Yeah,
If mount with the "remount" option doesn't work, there's no other way to change it from ro to rw. I've done it before on /var and /usr, but it may be that the OS won't allow it for / if it's the root filesystem Best wishes, Mike |
All times are GMT -5. The time now is 09:40 PM. |