Say you happened remove a disk from your RHEL/CentOS/Fedora system and left the entry to mount a partition in the fstab and rebooted. Well, you end up at a prompt for your root password and dropped into single user mode to resolve the problem before the system can boot up. I used to be able to just mount the root partition writeable by using any number of commands including “mount /” or “mount -rw /”. However, somewhere along the line that changed and those commands would not mount the filesystem as writeable. To workaround the issue, I previously used a distribution rescue disk or booted the distribution disk into rescue mode. Then, I would edit the fstab from rescue mode:

I usually chrooted the system disk:

chroot /mnt/sysimage

And then to make the changes:

vi /etc/fstab

I knew there had to be a better, more efficient way to do this, but just never took the time to figure out what is was, until now.

If you find yourself in similar situation, and need to edit a file or make some other changes to the filesystem from single user mode, this will do the trick:

mount -w -o remount /

Then, you can edit the fstab that you forgot to before carelessly removing that hard drive.