How to skip startup jobs for fstab? No timeout CENTOS7

3

1

I was working on CentOS7 by encrypting one of my drives which worked perfectly manually.

However, after making a mistake in the /etc/fstab and /etc/crypttab for mounting automatically it will get stuck looping indefinitely at

[***]A start job is running for dev-mapper-crypto.device

Any ideas on how to bypass this?

I tried running in runlevel 1 but it will try to mount it.

Bugger123

Posted 2015-12-15T13:32:29.827

Reputation: 31

I did some digging and I used emergency mode (Thanks to gawity) and mounting on rw my root partition with mount / -o remount,rw which I found at https://stackoverflow.com/questions/383595/repairing-fstab-read-only#383842

– Bugger123 – 2015-12-15T13:52:31.973

Answers

1

Boot with the emergency option (or -b for short) – this will skip almost everything. In case this leaves the root file system read-only, you can run mount -o remount,rw / once in the shell.

Or, boot with the systemd.debug-shell option – this will give you a shell on tty9 even while the system is booting. Then you can systemctl list-jobs and systemctl cancel.

Or, boot with the systemd.mask=mnt-whatever.mount – this will force systemd to ignore just that specific unit file. (Every fstab mount corresponds to a .mount unit, where / replaced is with -. For example, /mnt/my-data is mnt-my\x2ddata.mount.)


(Side note: systemd has no runlevels; the boot option for single-user mode is just that, single.)

user1686

Posted 2015-12-15T13:32:29.827

Reputation: 283 655

OMG you are a life saver! I used the emergency option and it worked! Now I will just remove the /etc/fstab entries. thanks! – Bugger123 – 2015-12-15T13:40:29.243

Ugh now I cant edit the fstab :S – Bugger123 – 2015-12-15T13:45:45.560

Try mount -o remount,rw / or boot with emergency rw instead of the usual ro. – user1686 – 2015-12-15T13:46:09.010

I used mount / -o remount,rw and fixed it thanks again :) – Bugger123 – 2015-12-15T13:53:32.797