-2

Apart from the main disk, I used to have another disk attached to the host which is /dev/vdb. In order to mount it automatically, I made changes in the /etc/fstab file.

While after I removed /dev/vdb, my CentOS 6.7 fails to start, and always stops with an error saying /dev/vdb is unavailable.

At this point, I can type the root password to enter into the command prompt, while when I trying to edit /etc/fstab file, it shows it is in read-only mode. I can't understand why it's read-only since I'm already the "root".

I'm sure removing the problematic line from fstab file would resolve my problem, but no idea of how to override the file. Can somebody help me out?

hailong
  • 1,409
  • 16
  • 19
  • Off-topic here, but anyway, you can try to remount / read-write with "mount -oremount,rw /". – janneb Feb 13 '17 at 08:51
  • 2
    Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Feb 13 '17 at 22:08
  • @janneb is right, remounting the drive with read-write resolve the problem eventually. The command I used is: `mount -w -o remount /` – hailong Feb 13 '17 at 22:54
  • Just realized this question is off-topic, thanks to @jww for pointing it out. – hailong Feb 13 '17 at 22:56

2 Answers2

1

Use a live-cd or -dvd to boot up your system (I find puppy linux works well for this task). Locate your /etc/fstab file on the hard drive and edit it manually.

Exit from the live-cd session, remove the disk and reboot normally. If /etc/fstab has been rewritten correctly you should start normally.

An alternative of course, is to reinstall the /dev/vdb device if possible and edit /etc/fstab if doing that boots correctly.

mcalex
  • 6,628
  • 5
  • 50
  • 80
  • I guess this should be working as well. While I resolved the problem with @janneb's comment, using this command: `mount -w -o remount /` – hailong Feb 13 '17 at 22:58
0

If it is a Virtual machine than you can mount the fs and make changes in /etc/fstab umount it and boot vm. or you can chroot into vm as well with

sudo chroot /path