LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-30-2014, 11:06 PM   #1
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Rep: Reputation: 47
Fstab of Debian vs Arch linux


I see that there are some differences in fstab of Debian and Arch linux:
Fstab from my Debian installation:
Code:
/dev/sda2  / ext4  errors=remount-ro  0  1
Debian wiki https://wiki.debian.org/fstab
Code:
/dev/sda2  / ext4  defaults  1  1

arch wiki https://wiki.archlinux.org/index.php/Fstab
Code:
/dev/sda2  /   ext4   defaults,noatime  0   1
tmpfs    /tmp  tmpfs  nodev,nosuid      0   0
Are they really the same or are these major differences? Which one do you prefer? Thanks for your explanation.

Last edited by rng; 01-30-2014 at 11:15 PM.
 
Old 01-31-2014, 08:43 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
The structure of the files is the same.

The different install routines have been designed to use different options in the "mount options" sections of the file.

This link may help some: http://www.linuxstall.com/fstab/ (My favorite fstab reference link at Tuxfiles.org seems to be off-line at the moment.)

The Debian excerpt ("errors=remount-ro"), if I understand it correctly, is saying that, if there are errors on remounting the partition, to mount it read only. My root partition has the same option on my Debian box. The citation from the Debian wiki is could be considered a "bare bones" fstab line with basic options.

man mount can provide a better description of the various mount options than I can.
 
2 members found this post helpful.
Old 01-31-2014, 09:49 PM   #3
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Is following all right?
Code:
/dev/sda2 / ext4 defaults,noatime,errors=remount-ro 0 1
 
Old 01-31-2014, 10:06 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
Nothing leaps out at me, but I am not an fstab expert. I've modified my own fstab, but I've never used that combination of options.

All I can say is that, if it doesn't work, change it back. Since it's your root partition, caution is indicated; an error means you will need to boot to a Live CD of something, mount the drive, and edit /etc/fstab, then reboot to the HDD.

In case it helps, here's the fstab from my Debian machine. The lines that are remarked out with a # are lines that I edited to replace with UUIDs; I left them in there in case it helps. (I remark out and keep the old lines so, if I get it wrong, it's easy to revert back.)

Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1       /               ext3    errors=remount-ro 0       1
UUID=ad52eed9-c80c-41fe-81a6-e8a9a71e6f19       /               ext3    errors=remount-ro 0       1
# /dev/sda5       none            swap    sw              0       0
UUID=35f7217b-f73b-4cd1-b513-571bd0482a18       none            swap    sw              0       0
# /dev/sdb1       /media/sdb1     ext3    rw,user,auto    0      1
UUID=1655a198-15a7-471f-9e99-e3fc9fd92ca0       /media/sdb1     ext3    rw,user,auto    0      1
# /dev/sdb5       /media/sdb5     ext3    rw,user,auto    0      1
UUID=7900ade7-de36-41e5-88b5-2d7aaa8adcd4       /media/sdb5     ext3    rw,user,auto    0      1
/dev/cdrom        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/cdrom1        /media/cdrom1   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
 
1 members found this post helpful.
Old 01-31-2014, 11:40 PM   #5
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
My current fstab is as follows and it is working well:
Code:
LABEL=debian   /   ext4   defaults,noatime,errors=remount-ro  0    1
tmpfs          /tmp   tmpfs     nodev,nosuid     0    0
/dev/sr0    /media/cdrom0   udf,iso9660 user,noauto         0    0
I added noatime to reduce unnecessary disk access and defaults since both debian and arch wiki suggest it. But I suspect 'defaults' is not needed here since it will be assumed for other options.

I have not added other partitions but they are seen in filemanager and get mounted on clicking. But then root password needs to be entered.

For /tmp on tmpfs there is this reference:
http://www.legendiary.at/2012/03/21/...fs-by-default/
Although on my Debian-wheezy it was not there in initial installation.

Thanks for your expert comments.

Last edited by rng; 02-01-2014 at 01:24 AM.
 
Old 02-01-2014, 09:15 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
If you edit fstab as root and enter the other partitions "rw,auto,user," they will be mounted automatically and user will have rights to read from and write to them.

Back in the olden days, before Linux got so good at discovering removable devices, I entered my MP3 player in fstab and gave it the "noauto" flag. Worked like a charm.
 
1 members found this post helpful.
Old 02-01-2014, 09:47 PM   #7
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
It really depends on what are the "defaults" which can vary between distros. But functionally the same IMO. The noatime does one less thing in terms of writes. Bad for auditing, good for limiting number of writes. And common for things like SSDs or USB sticks. But the "defaults" might include noatime, so hard to tell without further investigation.
 
Old 02-02-2014, 12:52 AM   #8
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Code:
It really depends on what are the "defaults" which can vary between distros.
I am using Debian-wheezy(stable). What are the defaults there?
In one link ( http://www.debianhelp.co.uk/fstab.htm ) it is equivalent to: rw,suid,dev,exec,auto,nouser,async.
Also, is 'proc' line really needed:
Code:
proc            /proc           proc    defaults        0       0
 
Old 02-02-2014, 08:55 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
My Debian system (started as Lenny and upgraded through Squeeze and Wheezy and now Sid) was installed with the same defaults you quoted in your first post; I think it's safe to assume that those are Debian's defaults.

Code:
 /dev/sda1     /      ext3    errors=remount-ro    0     1
 
1 members found this post helpful.
Old 02-02-2014, 10:06 PM   #10
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Why should'nt this work for all linux distributions?
 
Old 02-02-2014, 10:17 PM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
No reason it shouldn't work.

Different distros have different philosophies that reflect the philosophies of their maintainers. The most common variances are in the details of an install, the structure of /etc, and the package management. They may use different init routines: For example, Slackware uses BSD style scripts; Debian uses SystemV; others use SystemD. Ubuntu has its own thing called Upstart (Ubuntu has many of its own things).

Here's the / from Slackware's fstab:

Code:
/dev/sda3        /                ext4        defaults         1   1
Here's from Mageia (using UUID by default):

Code:
UUID=311ce3ab-6b2b-454c-80c3-3736b35e1528 / ext4 acl,relatime 1 1
The differences are one of the things that makes distro-hopping fun. They are also one of the reasons partisans of a particular distro can be so, well, partisan. Slackers, for example, love the simplicity of the BSD style init routine and the absence of a display manager for logging in--why start a GUI if you don't need one for what you are going to do?

Sometimes, you face choosing amongst equally good alternatives; every one of them has good pros and cons. Any choice you make will be valid, so you make your choice and go. And, to quote Satchel Paige, you don't look back.

Last edited by frankbell; 02-02-2014 at 10:26 PM.
 
1 members found this post helpful.
Old 02-03-2014, 02:31 AM   #12
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
What options are used when an external hard disk is connected through the usb port? There is no entry for such a disk in the fstab file.
 
Old 02-03-2014, 11:41 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
If it doesn't auto mount, then whatever options you pass to mount. If it does automount, probably just defaults or whatever that autofs stuff does.
 
1 members found this post helpful.
Old 02-03-2014, 06:54 PM   #14
rng
Senior Member
 
Registered: Aug 2011
Posts: 1,198

Original Poster
Rep: Reputation: 47
Quote:
whatever that autofs stuff does
In my Debian-stable system it is shown in file manager but does not automount. It mounts only on clicking on it but 'autofs' package is not installed. It must be doing by some other mechanism.
 
Old 02-03-2014, 08:14 PM   #15
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
When you click on it in the file manager in that way, the system mounts it. It should then stay mounted until you right-click on it and select "Safely Remove" or whatever message your file manager displays.

With externals that I intend to keep connected to a particular computer (basically as extra storage devices), I put them in fstab via UUID and set them to automount, like this one:

Code:
UUID=1655a198-15a7-471f-9e99-e3fc9fd92ca0    /media/sdb1   ext3    rw,user,auto    0      1
I use the UUID because that ensures they mount to the same mount point every time.

Here's a good tutorial on using UUIDs: http://www.cyberciti.biz/faq/linux-f...-update-fstab/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to compile only specific arch code (linux-3.8.2/arch/x86) ?. abdulrahuman.s@gmail.com Linux - Kernel 6 05-18-2013 04:09 PM
LXer: Arch BSD: Arch Linux Atop The FreeBSD Kernel LXer Syndicated Linux News 0 01-24-2013 03:20 PM
Arch Linux Installation Problems - arch-chroot, Grub2 Ronky Linux - Newbie 3 01-08-2013 05:22 PM
Arch or CloudLinux, RHEL, SLES, Oracle Linux, CentOS, Debian, Gentoo Rukiri Linux - Server 5 05-02-2012 12:45 AM
[SOLVED] Debian vs Arch linux for my needs on a laptop - advice requested MostViktorious Linux - Laptop and Netbook 7 01-11-2012 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration