You are not logged in.

#1 2011-03-27 02:00:35

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Fstab accidentally altered - does this now look acceptable?

Hi,
my /etc/fstab was inadvertently altered and I had to recreate most of it from memory.  I am able to boot into my system so this "works" but I do not believe it was identical to my prior version or if someone has any suggestions for improvements to the options.  I am sure all of the partitions are correctly linked to the entry (I had a list of it from my install):

# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/sda5 /boot ext3 defaults,noatime 0 1
/dev/sda10 swap swap defaults,noatime 0 0
/dev/sda3 / ext3 defaults,noatime 0 1
/dev/sda8 /home ext3 defaults,noatime 0 1
/dev/sda9 /usr ext3 defaults,noatime 0 1
/dev/sda7 /tmp ext3 defaults,noatime 0 1
/dev/sda6 /var reiserfs defaults,noatime 0 1

Thank you a lot!

Last edited by Tripsun (2011-03-27 02:04:11)

Offline

#2 2011-03-27 02:05:21

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Fstab accidentally altered - does this now look acceptable?

If it works and you believe it's correct. What more exactly are you asking?


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#3 2011-03-27 02:14:03

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

Well all I am sure of is that /dev/sda* is linked correctly to the /,/home, etc.

The rest I am very unsure about (i.e. the options, dump, pass).  For example, on the fstab page on the arch wiki, the boot partition only has defaults (not noatime).  As I am not that experienced with linux so I don't fully comprehend the various options, like the implications of using relatime vs noatime, or whether to use 0,1,2 for the dump/pass.

Last edited by Tripsun (2011-03-27 02:22:11)

Offline

#4 2011-03-27 02:22:15

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Fstab accidentally altered - does this now look acceptable?

Your fstab seems pretty OK to me. Nothing wrong whatsoever.
noatime is usually used on laptop to reduce harddisk activitives, nothing special (it means "no access time" if you ask me).


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#5 2011-03-27 11:25:29

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: Fstab accidentally altered - does this now look acceptable?

According to the fstab manpage (yep, there are ones for configuration files too wink) only the root filesystem should have the last field set to 1. I'm guessing what you have won't hurt anything, just slow down the process as all your partitions are checked at the same time.

Offline

#6 2011-03-27 11:39:34

lives2evil
Member
From: GMT+7
Registered: 2010-03-21
Posts: 244

Re: Fstab accidentally altered - does this now look acceptable?

In fact, by default arch set the last field (pass) to 1 for all partitions (except swap of course).


tsujeruplive, tnarongisi... ... ... ... ɥsılƃuǝ sı sıɥʇ

Offline

#7 2011-03-27 11:43:45

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Fstab accidentally altered - does this now look acceptable?

Some notes:

* Add an errors=remount-ro option to important partitions to avoid data corruption.
* Use persistent labelling (UUIDs or labels) to avoid dev nodes swapping names making your system unable to boot, see the wiki.
* noatime is not an accepted option for swap AFAIK. And it is useless even if it is accepted.
* Use nodev, nosuid and noexec wherever possible.
* Set pass to 2 on partitions other than /

HTH smile

Offline

#8 2011-03-27 14:13:28

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Fstab accidentally altered - does this now look acceptable?

and maybe barrier=flush for reiserfs partitions.

Offline

#9 2011-03-27 17:09:28

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

Thank you for all the responses.  How does this look?  I will add persistent labelling soon.

# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/sda5 /boot ext3 defaults,noatime 0 2 
/dev/sda10 swap swap defaults 0 0
/dev/sda3 / ext3 defaults,noatime,errors=remount-ro 0 1
/dev/sda8 /home ext3 defaults,noatime,nosuid,nodev,errors=remount-ro 0 2
/dev/sda9 /usr ext3 defaults,noatime,nodev,errors=remount-ro 0 2
/dev/sda7 /tmp ext3 defaults,noatime,nodev,nosuid,noexec 0 2
/dev/sda6 /var reiserfs defaults,noatime,nodev,nosuid,errors=remount-ro 0 2

I got the suggestions on where to put nosuid,nodev,noexec here so it would be great if someone could verify to make sure this is valid before I implement it: http://www.cyberciti.biz/tips/the-impor … tions.html

Offline

#10 2011-03-27 17:49:54

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Fstab accidentally altered - does this now look acceptable?

reiserfs doesn't support errors=remount-ro

Offline

#11 2011-03-27 18:13:33

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Fstab accidentally altered - does this now look acceptable?

/var should be noexec too (this is arch-specific, other distros may need to exec something from /var)... and again switch to UUID (see the output of /sbin/blkid).

Also, I wonder what is the size of your /var, because reiserfs is only effective when dealing with small files, and you might have pretty large packages in /var/cache/pacman/pkg. Therefore, I would recommend mounting only (small ~ 100Mb) /var/lib as reiserfs, and /var -- as ext4/jfs. Actually, this makes pacman's (<3.5) operations almost instanteneous on an average HDD.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#12 2011-03-27 19:34:16

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

Thanks for the help and I will add UUID soon.  As far as /var is concerned, is it possible to switch the filesystem since I have already made it reiserfs? 

Also, what does barrier=flush do for reiserfs (can't find much from google search).  Here is an updated version:

# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

/dev/sda5 /boot ext3 defaults,noatime 0 2 
/dev/sda10 swap swap defaults 0 0
/dev/sda3 / ext3 defaults,noatime,errors=remount-ro 0 1
/dev/sda8 /home ext3 defaults,noatime,nosuid,nodev,errors=remount-ro 0 2
/dev/sda9 /usr ext3 defaults,noatime,nodev,errors=remount-ro 0 2
/dev/sda7 /tmp ext3 defaults,noatime,nodev,nosuid,noexec 0 2
/dev/sda6 /var reiserfs defaults,noatime,nodev,nosuid,noexec,barrier=flush 0 2

EDIT: I added persistent labelling. I removed all of the /dev/sda* and replaced with UUID=[alphanumeric code] to match output of "sudo blkid"

Last edited by Tripsun (2011-03-28 01:49:47)

Offline

#13 2011-03-27 20:45:06

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Fstab accidentally altered - does this now look acceptable?

man mount

Mount options for reiserfs
..
barrier=none / barrier=flush
              This  enables/disables  the use of write barriers in the journaling code.  barrier=none disables it, barrier=flush enables
              it. Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to  use,  at
              some  performance  penalty.  The reiserfs filesystem does not enable write barriers by default. Be sure to enable barriers
              unless your disks are battery-backed one way or another. Otherwise you risk filesystem corruption in case of  power  fail‐
              ure.
..

Offline

#14 2011-03-27 21:19:09

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Fstab accidentally altered - does this now look acceptable?

Also http://www.linuxtopia.org/online_books/ … ebarr.html.

I don't think that you can switch from reiser to ext w/o reformatting, so I would back up /var with rsync (not with cp) in order to preserve timestamps. But I would also think twice, if the system is not freshly installed, because you may corrupt for instance pacman db...

Why do you need journaling (ext3) on /tmp, if it is being flushed every reboot? I would use ext2 for /tmp.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#15 2011-03-27 21:57:59

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Fstab accidentally altered - does this now look acceptable?

I rather use tmpfs for /tmp, and I do.

Offline

#16 2011-03-28 00:54:21

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

Well I would like to disable journaling then for /tmp since I agree that it is unnecessary.  To convert ext3 -> ext2 would I just need to do the following:

#sudo umount /dev/sda7
#sudo tune2fs -O ^has_journal /dev/sda7
#sudo e2fsck /dev/sda7

And then change ext3 to ext2 in /etc/fstab?  Or maybe it would be safer to do it from a live cd while nothing is mounted?

I think I will stick with reiserfs for /var for the time being.  Pacman 3.5 is very quick and I have no complaints.  I don't know that it is worth risking corruption for a small performance improvement.  Again, thanks for all the help!

Last edited by Tripsun (2011-03-28 00:56:28)

Offline

#17 2011-03-28 01:23:50

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: Fstab accidentally altered - does this now look acceptable?

edit: let me rephrase that...   /dev/shm on /tmp

Last edited by milomouse (2011-03-28 01:27:33)

Offline

#18 2011-03-28 04:42:20

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Fstab accidentally altered - does this now look acceptable?

Tripsun wrote:

Or maybe it would be safer to do it from a live cd while nothing is mounted?

Yes, that's a good idea.

JokerBoy wrote:

I rather use tmpfs for /tmp, and I do.

Well, I haven't seen any situation, when system performance was bounded by I/O from /tmp... thus I wouldn't mount it to RAM, or bind-mount /dev/shm to /tmp. Data stored in /tmp may prove useful in an event of a crash.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#19 2011-03-28 05:17:48

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

So those instructions look correct though?

And while I am at it, wouldn't it make sense to have /boot as ext2.  The journaling feature is not at all used on boot since the partition is never changed.  Just wastes space for the journal...

Offline

#20 2011-03-28 17:32:36

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Fstab accidentally altered - does this now look acceptable?

Tripsun wrote:

So those instructions look correct though?

And while I am at it, wouldn't it make sense to have /boot as ext2.  The journaling feature is not at all used on boot since the partition is never changed.  Just wastes space for the journal...

Yes to the 1st question and kind of (as in "I wouldn't bother", because /boot still contains kernel images, which are recreated at each kernel update) to the 2nd one smile

Last edited by Leonid.I (2011-03-28 17:33:48)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#21 2011-03-28 18:59:05

Tripsun
Member
Registered: 2011-01-22
Posts: 27

Re: Fstab accidentally altered - does this now look acceptable?

Ok thank you for your continued support.  Last couple of questions.  Before I do this change, would you highly recommend it/will I see any noticeable difference for what I am doing?  Is there any risk that I corrupt some the /tmp partition?

Second, while we're on the subject of altering file systems.  Would you recommend moving from ext3--> ext4 for the other file systems?  Most of the reviews that I read seem to highlight the boost in performance but is it noticeable? The wiki states that booting from ext4 is not officially supported (although I suppose this would only be an issue if I make /boot ext4.

Offline

#22 2011-03-28 20:42:12

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Fstab accidentally altered - does this now look acceptable?

No problem smile

Generally, I usually try to avoid deep FS layout changes after the installation -- such decisions are made at install time.

Regarding /tmp and the question of removing journal vs keeping it, I usually prefer the former, even if the pros (e.g. performance) are not readily visible, simply because there are two less jbd2/ext4-dio-unwrit processes to run and there is no risk of data corruption.

Regarding switching from ext3 to ext4 on a working system, I don't think it's a good idea due to following reasons:
1. The system is up and running fine (?), and works as expected (?).
2. Benchmarks pointing out performance boosts are inconclusive; these improvements depend on the task at hand, and usually negligible in general-purpose systems.
3. Many consider ext4 as an intermediate step to btrfs, so if you have to, switch to btrfs directly (after some time).

Finally, there is no problem using ext4 as /boot -- I have it on 4 systems with no problems.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

Board footer

Powered by FluxBB