LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-20-2016, 09:53 PM   #1
korn_16_f_t_l
Member
 
Registered: Sep 2004
Posts: 69

Rep: Reputation: 18
fstab editing


so i have got my server up and running and my 3TB hdd is shared over my network over samba, now comes streaming media via plex as well as a few other minor detail such as the second hdd not auto mounting on restart.

so i have been reading about editing my fstab file so that devices automatically mount on boot this subject first came up when searching why i can not find any sub directories in Plex while using the browse option to set up libraries (see article here: http://ubuntuforums.org/showthread.php?t=2087341 )

i attempted to edit my fstab and i had horrible results i had to remove the add'd line so i must have done something wrong, what im hoping for is that someone can help me write the line that i do need to add in the fstab so i dont make this error again.

according to the site i was reading (see here: http://askubuntu.com/questions/16492...n-ubuntu-12-04 ) i need a few things

Code:
UUID=<uuid> <pathtomount> <file system> uid=<userid>,gid=<groupid>,umask=0022,sync,auto,rw 0 0
so i obtained most if not all of the information
Code:
/dev/sda1: UUID="2bd1c8c3-2e6e-433c-ab3c-d5311b98bcd3" TYPE="ext4" 
/dev/sda5: UUID="a53e2978-0c37-438f-a799-60c934be68e6" TYPE="swap" 
/dev/sdb1: LABEL="Network Storage" UUID="686f24ec-b686-4dda-b4b6-0a69a2d6602e" TYPE="ext4"
now
Quote:
/dev/sdb1: LABEL="Network Storage" UUID="686f24ec-b686-4dda-b4b6-0a69a2d6602e" TYPE="ext4"
is the device i would like to auto mount on boot up with the following path (whats displayed in the dolphin property's for the HDD's root directory)

Quote:
/media/korn16ftl3/Network Storage/
my user id is
Quote:
korn16ftl3@UBUNTU:~$ id -u korn16ftl31000
my group ID is as follows:
Quote:
korn16ftl3@UBUNTU:~$ id --groups1000 4 24 27 30 46 107 113
now if im following the instructions correctly the line i need to add should be something like this

Code:
UUID=686f24ec-b686-4dda-b4b6-0a69a2d6602e /media/korn16ftl3/Network Storage/  type=ext4 uid=1000,gid=1000 4 24 27 30 46 107 113,umask=777,sync,auto,rw 0 0
i have no idea what a umask is but in a quick google search it said it assigns read and write permissions.....personally seeing as how this drive is also my samba drive as well as where my media is stored i would like read write and execute privileges to it when it is auto mounted.

so what im looking for is is this peice of code ready to copy and paste right to my fstab file? what would you guys change about it? i didnt do anything crazy that will screw something up like to many spaces or anything did i?

i have been known to not have correct linux punctuations shall we call it? before where to many spaces screwed me up every time in the CLI
 
Old 03-20-2016, 10:20 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,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
This link helped me when I started to use UUIDs in /etc/fstab. http://www.cyberciti.biz/faq/linux-f...-update-fstab/

I'm no expert, just a hobbyist, but I think that you can use a label or a UUID in /etc/fstab, but not both.
 
Old 03-20-2016, 11:52 PM   #3
przemo
Member
 
Registered: Feb 2016
Location: cork.ie
Distribution: Slackware-current
Posts: 162

Rep: Reputation: Disabled
gid=1000 4 24 27 30 46 107 113

i think that part is incorrect, but im guessing.
 
Old 03-21-2016, 02:32 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,574
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Only one group can be given here. The mounted disk will belong to the user and group specified, like any file does. Do an ls -l in any directory and you will see what I mean. Each file belongs to one user and one group. If you want the disk to belong to you, it's easiest to use your login group. But in practice you seldom need to give these options; the default ones usually work just fine.

A umask is simply a mask which determines the default permissions of any new files created on the disk.

Last edited by hazel; 03-21-2016 at 02:58 AM. Reason: Wrong information edited out.
 
Old 03-21-2016, 04:26 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
additionally you should not specify mount directory containing space, you will have difficulties (/media/korn16ftl3/Network Storage/)
 
Old 03-21-2016, 08:44 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Several problems:
  1. The uid, gid, and umask options do not apply to Linux native filesystems like ext2/3/4. They are for filesystems like FAT that don't support Unix-style ownership and permissions. To set ownership and permissions in ext2/3/4 filesystems, use chown, chgrp, and chmod while the filesystem is mounted.
  2. As was mentioned before, you should not use both LABEL and UUID. Use one or the other.
  3. The fstab format does not support quoted strings. The quote characters will be taken literally. To represent a space character, use its octal escape %040.
 
Old 03-21-2016, 03:46 PM   #7
korn_16_f_t_l
Member
 
Registered: Sep 2004
Posts: 69

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by rknichols View Post
Several problems:
  1. To set ownership and permissions in ext2/3/4 filesystems, use chown, chgrp, and chmod while the filesystem is mounted.
so what should i actually input into the CLI to get the hard drive to mount automatically when the computer boots up?
 
Old 03-21-2016, 03:53 PM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
for example, but you should know what do you really need:
UUID=686f24ec-b686-4dda-b4b6-0a69a2d6602e /media/korn16ftl3/Network_Storage/ type=ext4 sync,auto,rw 0 0
take care about that space (replaced to _)
 
Old 03-21-2016, 05:51 PM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by pan64 View Post
for example, but you should know what do you really need:
UUID=686f24ec-b686-4dda-b4b6-0a69a2d6602e /media/korn16ftl3/Network_Storage/ type=ext4 sync,auto,rw 0 0
take care about that space (replaced to _)
I don't think you want that "type=" there. Also, if this is an external drive, I suggest including the "nofail" option so that the machine will still boot even if the drive is not present or fails to mount for some other reason. And, the "auto" and "rw" options are the default, and so need not be included.
Code:
UUID=686f24ec-b686-4dda-b4b6-0a69a2d6602e /media/korn16ftl3/Network_Storage ext4 sync,nofail 0 0
Or, if you really, really want that space in the directory name:
Code:
UUID=686f24ec-b686-4dda-b4b6-0a69a2d6602e /media/korn16ftl3/Network%040Storage ext4 sync,nofail 0 0
 
Old 03-22-2016, 01:13 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
yes, you are right, that was my mistake. sorry
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing Fstab linda Linux - General 4 09-03-2006 01:59 PM
Editing my fstab .... please help zcapx32 Linux - Hardware 5 07-07-2006 03:03 PM
editing the fstab geckoguykc Linux - Newbie 3 05-03-2006 06:58 PM
Editing etc/fstab- yet again:-) hitest Slackware 7 04-21-2005 12:50 PM
editing the etc/fstab firefightin4fun Linux - Newbie 8 09-20-2003 10:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:00 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