LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Testing fstab without restart? (https://www.linuxquestions.org/questions/linux-general-1/testing-fstab-without-restart-854727/)

centosfan 01-06-2011 06:57 PM

Testing fstab without restart?
 
I need to do some changes to fstab,so i wondering is it possible to test it does it work without restating?Because if add something wrong then linux wont start ssh and i wont be able to access server remotely.What i want to do,is to mount /dev/shm with noexec,nosuid instead none.

AlucardZero 01-06-2011 08:28 PM

Use umount and mount. No harm done to me.
Code:

$ grep shm /etc/fstab
tmpfs                  /dev/shm                tmpfs  rw,nosuid,nodev        0 0
$ mount | grep shm
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
$ sudo umount /dev/shm
$ mount | grep shm
$ sudo mount /dev/shm
$ mount | grep shm
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)


novice06 01-06-2011 08:53 PM

You can try to mount, if there is any typo error or wrong directory, it will give you message at standard out.
mount -a
mount: mount point /boots does not exist
mount: mount point swap does not exist

trickykid 01-07-2011 12:41 PM

My advice, don't do a mount -a unless you just have to, that's just bad practice if it's just one mount point you need to deal with. Read the man page to learn what the -a does and why you think it might not be a good idea to run on an existing running system.

If you want to test new mount options, don't even edit fstab until you know they work properly.

Just do something like:

mount -o rw,nosuid,noexec,remount /dev/shm

Test, if all seems good, then proceed with editing your fstab and go from that point on.

centosfan 01-07-2011 01:24 PM

Yes i used command mount -o remount /dev/shm and it worked pretty fine.


All times are GMT -5. The time now is 01:02 AM.