Broke my fstab and cannot boot

I’m typing from my phone.

My laptop is Asus G75VX running OpenSuse 13.1

I edited my fstab file to automount my internal 2nd hard drive which is NTFS formatted. I did some thing wrong and cannot boot.

Previously I would manually mount the drive after boot up. It would mount at /var/run/media/jeremy/Storage, so that is the path I put for the drive in fstab, and I put the options to default. I then saved and closed the fstab file and rebooted.

Laptop will not boot now. It says it found the drive but cannot mount it.

  1. Did I enter a bad file path for it? Or do something else wrong?
  2. How do I boot in console mode so I can fix the fstab?

P.s. Before editing the fstab I used Yost partitioned to set the drive to mount but it would not add anything to the fstab, which is I manually added it to the fstab.

You can access you system with a live dvd of 13.1
See this: https://forums.opensuse.org/content/146-using-livecd-take-over-repair-installed-system.html

Once chroot you can edit /etc/fstab

But there should be a backup of the old file created when you made the edit, you could check for that…

You don’t need a Live DVD for this.

If a drive cannot be mounted, the system should enter emergency mode automatically.
Just enter the root password, and you should be able to edit the fstab.

You can add nofail to the mount options, then your system should boot even when the drive can’t be mounted.

I have no idea what you did wrong (how should I? :wink: ), you should post your /etc/fstab to get help.

If emergency mode does not work for some reason, just add “init=/bin/sh” to the boot options, you will get to a text mode shell (without having to enter a password) then.

When it enters emergency mode it keeps giving me the welcome to emergency mode message and does not let me enter my root password. It’s just an infinite scroll of the welcome message.

Also, when I boot from the dvd into rescue mode it asks me for a rescue login. I try to enter my normal user and password but it won’t accept it.

Well, how should the DVD know your username/password… :wink:
I don’t think there’s any login needed when boot from the DVD.

Ah. I’ve seen that with the Beta versions.

Have you tried to add “init=/bin/sh” to the boot options as I suggested? That should work.
Press ‘e’ at the boot menu, search for a line starting with “linux” and append it at the end. Then press ‘F10’ to boot.

I appended as you described. I was brought to a sh-4.2# prompt. How do I get into the fstab from there?

In case it matters, the two lines before the prompt say:
Sh: cannot set terminal process group (-1): inappropriate ioctl for device
Sh: no job control in this shell

Well, I thought you knew how to edit the fstab… :wink:

I don’t know which text editors you have installed, but try:

vim /etc/fstab

or

emacs /etc/fstab

or

joe /etc/fstab

or

mcedit /etc/fstab

or

nano /etc/fstab

or

pico /etc/fstab

or

I am used to nano the but had not installed it yet. So, I tried your via suggestion, got into the fatal file and deleted the bad line I added. Now I don’t know how to save and close vim :frowning:

Press ESC to exit insert mode if necessary, and type:
:wq<Enter>
(including the ‘:’)

Or type this for help:
:help<Enter>

**** auto correct on my phone. It should say that I used vim to edit the fstab but now I don’t know how to save and close with vim.

On 2013-11-26 15:06, jdavidallen wrote:
>
> jdavidallen;2602151 Wrote:
>> I am used to nano the but had not installed it yet. So, I tried your via
>> suggestion, got into the fatal file and deleted the bad line I added.
>> Now I don’t know how to save and close vim :frowning:
>
> **** auto correct on my phone. It should say that I used vim to edit the
> fstab but now I don’t know how to save and close with vim.

Joe is easier, and it is installed by default since years ago, as a
replacement for “vi” for users like us. Even the small rescue system has it.

On 2013-11-26 06:36, jdavidallen wrote:

> I edited my fstab file to automount my internal 2nd hard drive which is
> NTFS formatted. I did some thing wrong and cannot boot.
>
> Previously I would manually mount the drive after boot up. It would
> mount at /var/run/media/jeremy/Storage, so that is the path I put for
> the drive in fstab, and I put the options to default. I then saved and
> closed the fstab file and rebooted.

The directory “/var/run/media/jeremy/Storage” does not exist, it is
automatically created by the automount system. As you are mounting via
fstab, that automatic creation does not run.

You should instead mount at “/mnt/Storage”, and make sure you create
that directory first, empty. Leave the entire “/var/run/media/” tree to
the automatics. /mnt/ is yours alone.

Next time do not reboot to test fstab. Instead mount that entry manually:


mount /mnt/Storage

When that works, then you can reboot with confidence.

On 2013-11-26 14:16, jdavidallen wrote:
> Also, when I boot from the dvd into rescue mode it asks me for a rescue
> login. I try to enter my normal user and password but it won’t accept
> it.

It should be login=root, and no password. Or nothing at all.

Next time, you can download in advance the dedicated XFCE rescue image
from the openSUSE site, and put it on an USB stick. It is not
installable, it is a rescue system, with graphics (XFCE).


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Thanks Carlos.
I figured out how to use vim, so I was able to delete the bad line from fstab and get my laptop to reboot.

Now that I am back into my computer I edited the fstab to look like this:

/dev/disk/by-id/ata-Samsung_SSD_840_Series_S14JNEAD301712N-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-Samsung_SSD_840_Series_S14JNEAD301712N-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-Samsung_SSD_840_Series_S14JNEAD301712N-part3 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-Hitachi_HTS727575A9E364_J3740084J2TJ8E-part4 /mnt/Storage    NTFS    defaults

However, when I type “mount /mnt/Storage” into the terminal I get no response in the terminal, so I use the file browser to navigate to /mnt/Storage and I get this message at the top of the file browser:

Error mounting system-managed device /dev/sdb4: Command-line `mount "/mnt/Storage"' exited with non-zero exit status 32: mount: unknown filesystem type 'NTFS'


Not sure what to do now.

Two things:

  • There is no “NTFS”. It should either be “ntfs” (the older in-kernel read-only ntfs filesystem) or “ntfs-3g” (the newer fuse filesystem that supports writing as well)
  • You miss “0 0” at the end of the line (look at the other entries)

So the line probably should be:

/dev/disk/by-id/ata-Hitachi_HTS727575A9E364_J3740084J2TJ8E-part4 /mnt/Storage    ntfs-3g    defaults 0 0

Perfect. Thanks :slight_smile: