Page 1 of 3

How to edit fstab?

Posted: 2013/10/04 13:39:58
by agriz
I just read in cenos wiki the following

[code]

/dev/VG_OS/lv_root / ext3 defaults 1 1
/dev/VG_OS/lv_tmp /tmp ext3 defaults,nosuid,noexec,nodev 1 2
/dev/VG_OS/lv_vartmp /var/tmp ext3 defaults,nosuid,noexec,nodev 1 2
/dev/data_vol/lv_home /home ext3 defaults,nosuid,nodev 1 2
/dev/VG_OS/lv_var /var ext3 defaults,nosuid 1 2
/dev/data_vol/lv_web /var/www ext3 defaults,nosuid,nodev 1 2
/dev/sda1 /boot ext3 defaults,nosuid,noexec,nodev 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
/dev/_VG_OS/lv_swap swap swap defaults 0 0

[/code]

can i just type

[code]vi /etc/fstab[/code]

to make the changes in the file?
is it just making text edits on the file? or executing commands?

Additionally what is the meaning for the first column? Is it just some lables which can be edited?

Re: How to edit fstab?

Posted: 2013/10/04 14:18:45
by gerald_clark
man fstab

If you don't know what you are doing, don't mess with it.

Re: How to edit fstab?

Posted: 2013/10/04 14:26:40
by agriz
[quote]
gerald_clark wrote:
man fstab

If you don't know what you are doing, don't mess with it.[/quote]

I don't know what am i doing.
But where can i know those things? :(

The second and third columns are not editable.
They are the partitions and its types.

Re: How to edit fstab?

Posted: 2013/10/04 14:52:08
by gerald_clark
You need to read:
http://www.centos.org/modules/newbb/viewforum.php?forum=47
https://access.redhat.com/knowledge/docs/

Beginners Linux: http://rute.2038bug.com/index.html.gz

Re: How to edit fstab?

Posted: 2013/10/04 15:35:48
by agriz
Thanks for the bigger linux link.

Well,

[code]
UUID=a674c840-19c7-4d2e-a44c-ee0ea6028e42 /boot ext4 defaults 1 2
[/code]

If i directly edit the fstab with vim editor

[code]
UUID=a674c840-19c7-4d2e-a44c-ee0ea6028e42 /boot ext4 defaults,nosuid,noexec,nodev 1 2
[/code]


or

[code]
mount -o defaults,nosuid,noexec,nodev,remount UUID=a674c840-19c7-4d2e-a44c-ee0ea6028e42 /boot
[/code]

what is the difference?

I didn't try the mount command.
Is that right?


In the first column,

none
UUID=..
/dev/hda1

What is the difference?

/dev/hda1 is the partition which will be mounted on "/" or "/boot" or something. What about the others?


if it is none in the first column, should i mount it like this?
[code]
mount -o defaults,nosuid,noexec,nodev,remount none /boot
[/code]

What if there are two none in the first column?
Can the first column have same lable?

Thanks for helping me

Re: How to edit fstab?

Posted: 2013/10/04 15:46:37
by gerald_clark
Don't mess with fstab unless you have a good reason.
You have not given a good reason.

Re: How to edit fstab?

Posted: 2013/10/04 15:50:07
by agriz
wiki centos starts the security with fstab

Re: How to edit fstab?

Posted: 2013/10/04 15:52:23
by TrevorH
Did you read `man fstab`? It answers most questions about what the various fields mean.

Re: How to edit fstab?

Posted: 2013/10/04 15:56:03
by agriz
[quote]
TrevorH wrote:
Did you read `man fstab`? It answers most questions about what the various fields mean.[/quote]

Am i wrong with my examples?
..
Yes, I read the man fstab

[code]This field describes the block special device or remote filesystem to be mounted.[/code]

I didn't find the "none" meaning for the first field.

Re: How to edit fstab?

Posted: 2013/10/04 16:21:19
by gerald_clark
If you ask a specific, pertinent question instead of making random undocumented statements, you might get a good answer.