LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Emergency mode fstab (https://www.linuxquestions.org/questions/linux-general-1/emergency-mode-fstab-4175603891/)

ComputerCritic 04-15-2017 11:32 AM

Emergency mode fstab
 
Hello, I am using OpenSUSE Leap 42.2. I made a typo in fstab by commenting a whole line that was /dev/system/home. Now I just want to comment, I think #/home, and the columns after that. I tried editing but it was read-only. I tried :wq! but it didn't work. I think I'm running as root. How do I make fstab writable?
I tried mount / -o remount,rw but It just let me type an indefinite number of lines. How do I exit that?

lazydog 04-15-2017 03:15 PM

To check if you are root run;
Code:

whoami
Not sure what you mean with comment out HOME. If you mean that line you just need to remove HOME from that line as you cannot comment out just home from it without commenting out everything that follows.

syg00 04-15-2017 06:17 PM

Start by rebooting - force by holding the power button in need. That way we know what state you are in. Try the command as
Code:

mount -o remount,rw /

frankbell 04-15-2017 10:18 PM

For what it's worth, whenever I change a line in /etc/fstab, I remark out the original line and create a new line. That makes it easier, if I muck it up, to revert to the previous configuration. That has saved my bacon several times.

If worse come to worse, you can boot to a Live CD of something, mount the root partition, and edit /etc/fstab from there.

ComputerCritic 04-16-2017 10:18 AM

Quote:

For what it's worth, whenever I change a line in /etc/fstab, I remark out the original line and create a new line. That makes it easier, if I muck it up, to revert to the previous configuration. That has saved my bacon several times.

If worse come to worse, you can boot to a Live CD of something, mount the root partition, and edit /etc/fstab from there.
How do I mount from a live CD?
And, I tried rescue system. Couldn't find out how to mount it from there.

ComputerCritic 04-16-2017 10:20 AM

Quote:

Originally Posted by syg00 (Post 5697471)
Start by rebooting - force by holding the power button in need. That way we know what state you are in. Try the command as
Code:

mount -o remount,rw /

No I didn't back up my files.

mrmazda 04-17-2017 04:00 AM

Quote:

Originally Posted by ComputerCritic (Post 5697664)
How do I mount from a live CD?
And, I tried rescue system. Couldn't find out how to mount it from there.

It's not hard. Once booted into the rescue system you'll have a shell prompt. Do
Code:

mount --help
Next, try
Code:

fdisk -l /dev/sda
or
Code:

gdisk -l /dev/sda
The first entry that is not type swap will probably be your openSUSE root partition, probably /dev/sda1, in which case, do
Code:

mount -t auto /dev/sda1 /mnt
If you're not sure about which entry is your openSUSE root partition, try
Code:

blkid /dev/sda3
or whichever # you think is the right one. That will report UUID, volume label, filesystem type and more.

fatmac 04-17-2017 08:08 AM

The file /etc/fstab is a system file therefore you must be the root operator to save changes to it.
(You can also use sudo if it is configured on your system.)


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