Page 2 of 3

Re: How to edit fstab?

Posted: 2013/10/04 16:24:52
by agriz
[quote]
gerald_clark wrote:
If you ask a specific, pertinent question instead of making random undocumented statements, you might get a good answer.[/quote]

Can you give me an example specific, pertinent question related with fstab modification.
I didn't get you clearly.

Re: How to edit fstab?

Posted: 2013/10/04 16:34:21
by gerald_clark
You have not given any reason for your fstab change, nor any description of what you want to change.
When you come back with a real documented question, I may respond..

Re: How to edit fstab?

Posted: 2013/10/04 17:02:11
by agriz
[quote]
gerald_clark wrote:
You have not given any reason for your fstab change, nor any description of what you want to change.
When you come back with a real documented question, I may respond..[/quote]

I am reading everywhere that securing fstab is important.
Centos wiki is also recommending changing fstab.

i just read the ubuntu forum.
[code]sudo vi /etc/fstab[/code]

Which means, i guess, we can edit the fstab and make the changes as described in the centos wiki (securing centos)

Re: How to edit fstab?

Posted: 2013/10/04 17:11:08
by agriz
/***
off-topic question
***/

I am sure you must have used lot of linux distributions.
From you experience which server do you recommend?

Centos or Ubuntu? (for a beginner)

Re: How to edit fstab?

Posted: 2013/10/04 18:42:54
by TrevorH
I don't see a "none" in the first field of your fstab (nor any of mine either come to that).

In `man 5 fstab` I see documentation for none in the 2nd and 3rd fields but not for the first..

Re: How to edit fstab?

Posted: 2013/10/05 05:17:59
by agriz
My first post on this topic is sample fstab which is secured.

I have a centos minimal on my computer

the fstab on my computer is

[code]
/dev/mapper/Vol.._root / ext4 defaults 1 1
UUID=....0d5 /boot ext4 defaults 1 2
/dev/mapper/.. /home ext4 defaults 1 2
/dev/..swap swap swap defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
[/code]

So how do i add the /tmp /var/ /var/www in fstab?
How do i change /home /boot and others defaults values?

Re: How to edit fstab?

Posted: 2013/10/05 06:26:04
by agriz
[code]
http://www.cyberciti.biz/faq/howto-mount-tmp-as-separate-filesystem-with-noexec-nosuid-nodev/
[/code]

The above link tells how to modify the fstab. How to add tmp in fstab as a separate file system!

[code]
mount -o remount,nosuid,nodev /home
mount -o remount,nosuid,noexec,nodev /boot
[/code]

If there is any mistake let me know.
If it is possible, let me know how to add /var /var/www on the fstab

Thanks for helping

Re: How to edit fstab?

Posted: 2013/10/05 07:52:46
by TrevorH
To create new separate filesystems is more complicated than just adding an entry to /etc/fstab. First, you need to create a new partition or a new Logical Volume and format it using the mke2fs command. Then you have to temporarily rename the original location that you want to move to a separate mount point, create a new directory called what you want it to be mounted as, mount the new filesystem there, copy all the data over from the old location to the new, add the fstab entry, umount the new mountpoint and run `mount -a` to check that it mounts correctly (this is what it does during boot up for you). If we're talking about a new /tmp then you also need to set the permissions to 1777 on the new mount point.

Re: How to edit fstab?

Posted: 2013/10/05 08:02:08
by agriz
I used mkfs.ext4 to format
what is the difference between 0777 and 1777?

I used 0777

mount -a returns nothing for me!

[code]
mount -o remount,nosuid,nodev /home
mount -o remount,nosuid,noexec,nodev /boot
[/code]

Is this two command right?

Re: How to edit fstab?

Posted: 2013/10/05 15:01:27
by TrevorH
[quote]
what is the difference between 0777 and 1777?
[/quote]

`man chmod` details the various bit settings but the 1 is 'sticky'. It's required for /tmp

[quote]
mount -a returns nothing for me!
[/quote]

Means there were no errors while mounting all available filesystems in fstab