Page 1 of 1

Manually Mount an FSTAB entry

Posted: 2020/06/02 22:14:47
by thomas.deans
I have my CentOS 7 box on a UPS and recently we had a power blip where the whole home had power but just the circuit dipped. It wasn't enough to trip the breaker but my UPS beeped and kicked in for half a second before going back to UPS pass through power. Our Dyson was plugged into that circuit and my son (4) was playing with the on/off switch and i believe this is what caused the brown out like situation. Although im on a UPS for some reason my server decided to reboot. I didnt notice until a few days later when I needed to browse on my portable apps firefox that my ssh session wouldnt connect. I use a proxy tunnel for FF to browse through my server from whever I am for privacy.

Upon checking my terminal I find that my box is sitting in emergency mode. furtgher inspection is showing a failed mount for one of my external USB drives. I have a home media server with the media mount tied to this external. Its a quite old Seagate 320GB external that has been tied to various linux boxes for over ten years, ive repaired it before from jumping mounts mounted in fstab via /dev/sdb/x/d etc where it lost connection and jumped dev names and letters. Thats when i did a superblock recovery to regain my data and then converted to an GUID mount in fstab. Once I did that anything that couldnt be read was replaced and I thankfully was able to save about 280GB of MP4's. Thats when I setup the rclone backup which has been great as a oneway secondary backup..

I reboot my box and sign into root on the emergency terminal and then edit my fstab to comment out that drive.
upon reboot, everything comes up and Im back in business.

This drive is mounted in fstab via GUID, I have the drive backed up to google drive via rclone so i/m not worried about the lost data. I would however like to manually remount this drive and do any file checks to see if i can use it until i get a replacement drive. This server is on a Lenovo M72 Tiny platform so unfortunately I need an external for my Media drive and that has to be USB. In the case of USB iv'e read and found that GUID mount works the best.

I know I could uncomment and run mount -a but is there any way to convert the line in fstab to a mount command so that i could manually mount only and leave it commented out in fstab in the case of reboots for updates or power loss doesnt affect it starting?

this is a concern for me due to my need for proxy browsing and the fact that I'm hosting my website from this machine as well.

Re: Manually Mount an FSTAB entry

Posted: 2020/06/02 22:53:40
by TrevorH
There's a whole raft of ways you can do it. You can add nofail to the options in fstab so that it's not essential for boot. Or you can use a systemd mount unit file instead of fstab and you should be able to set that up so it mounts it when it's plugged in or powers on. Or you can just mount UUID="longstring" /mountpoint

Re: Manually Mount an FSTAB entry

Posted: 2020/06/03 00:29:24
by thomas.deans
I must admit I failed to look at all the fstab options when i changed it from /dev/sdx1/2/3 etc to GUID mount style. I used a inux reference that had multiple examples, IF I had seen an option for nofail and known that it would fail to boot from a drive failure, I would have implemented that option.

Kudos to you sir for alerting me to the "nofail" option. I believe this is going to be the correct answer for me.

Sincerely, Thank You!.

Now, do I need to or is there a way to mark as correct answer in CentOS forums? What are my next steps with this post? I'm pretty new to these forums.