LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-15-2017, 11:32 AM   #1
ComputerCritic
Member
 
Registered: Mar 2017
Posts: 43

Rep: Reputation: Disabled
Unhappy 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?

Last edited by ComputerCritic; 04-15-2017 at 11:33 AM.
 
Old 04-15-2017, 03:15 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
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.
 
Old 04-15-2017, 06:17 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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 /
 
Old 04-15-2017, 10:18 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,272
Blog Entries: 28

Rep: Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124Reputation: 6124
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.
 
Old 04-16-2017, 10:18 AM   #5
ComputerCritic
Member
 
Registered: Mar 2017
Posts: 43

Original Poster
Rep: Reputation: Disabled
Question

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.
 
Old 04-16-2017, 10:20 AM   #6
ComputerCritic
Member
 
Registered: Mar 2017
Posts: 43

Original Poster
Rep: Reputation: Disabled
Exclamation

Quote:
Originally Posted by syg00 View Post
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.
 
Old 04-17-2017, 04:00 AM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,788
Blog Entries: 1

Rep: Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065
Quote:
Originally Posted by ComputerCritic View Post
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.
 
Old 04-17-2017, 08:08 AM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan with some Tiny Core, Fatdog, Haiku, & BSD thrown in.
Posts: 5,442

Rep: Reputation: Disabled
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.)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] System boots into emergency mode when USB drives in fstab vonedaddy Linux - Desktop 3 09-30-2012 01:44 PM
what should be done in emergency mode? and why...? irajjs Mandriva 6 08-07-2012 10:19 AM
Unable to Access to Single User Mode or Emergency Mode Pinglu Linux - Newbie 3 10-17-2011 01:25 PM
Emergency mode can mount the HDD with FS error but not in rescue or single user-mode kayod_jj Linux - Newbie 3 12-01-2010 07:03 PM
update fstab failed ?... pleas it emergency state linux trainer Linux - Newbie 3 11-09-2009 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration