Automount

Automount

Postby abloylas » 08 Oct 2013, 10:50

Hi!
I'm new here and this is my first question.
I have a separate Data partition formatted as ntfs with the Dropbox folder on it. I need this automounted at boot so Dropbox can access it.
What is the correct line to put in /etc/fstab? Do I need to change something else?
It would be good if this distro had a gui app for editing fstab. Mint has something called gnome-disks that handles auto-mounting.
abloylas
 
Posts: 9
Joined: 08 Oct 2013, 10:38

Re: Automount

Postby Maroman » 08 Oct 2013, 12:10

first find the partition
Code: Select all
sudo fdisk -l

or
Code: Select all
sudo blkid

and creat directory (you have Data, ntfs partition)
Code: Select all
sudo mkdir /media/Data

start editing /etc/fstab. you can use
Code: Select all
gksu pluma /etc/fstab

for editing fstab no tool is needed. Linux has even more tools than you need.

at fstab add the line
Code: Select all
/dev/sdaX    /media/Data    ntfs-3g    rw,users,auto    0    0

where sdaX is partition id as a result of first command (if you have more than one disc it might be sdb1 etc).

restart. at next login you see mounted partition Data.

cheers,
Last edited by Maroman on 08 Oct 2013, 13:00, edited 1 time in total.
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: Automount

Postby Maroman » 08 Oct 2013, 12:35

look, it's example of my fstab
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc   /proc   proc   defaults   0   0
# /dev/sdb6
UUID=9f0f9943-b1f9-4c5c-b173-a5a7a0642611   swap   swap   sw   0   0
# /dev/sdb7
UUID=943495f5-78b8-44bb-9853-5b94758f0d8f   /   ext4   relatime,errors=remount-ro   0   0
# /dev/sda1 Depot
/dev/sda1   /media/Depot   ntfs-3g    rw,users,auto   0   0
# /dev/sdb5 Storage
/dev/sdb5   /media/Storage   ext4   defaults,users,auto   0   0

I mounted two partitions - Depot and Storage - one is ntfs, second - ext4 (I have three discs and systems are on the second one).
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: Automount

Postby abloylas » 08 Oct 2013, 13:31

Thanks for replying. But the partition doesn't get mounted on boot. When I click on it in Caja I get this.

"Error mounting: mount exited with exit code 1: helper failed with:
mount: only root can mount /dev/sda5 on /media/Data"

Should I change the owner of /media or /media/Data or do something else?

You say that no tool is _needed_ to edit fstab. That is of course true. What I'm saying is it would be _handy_ to have one installed. Just like it would be handy to have bash-completion installed.
abloylas
 
Posts: 9
Joined: 08 Oct 2013, 10:38

Re: Automount

Postby Maroman » 08 Oct 2013, 14:08

did you do exactly as I wrote? it must be something with ownerships/permitions of mounted directories. I've check mine and look
maroman@acese:/media$ ls -l
total 12
drwxrwxrwx 1 root root 4096 Oct 4 15:09 Depot
drwxr-x---+ 3 root root 4096 Oct 8 14:57 maroman
drwxrwxrwx 9 root root 4096 Oct 3 18:59 Storage
maroman@acese:/media$ cd Depot/
maroman@acese:/media/Depot$ ls -l
total 8164
drwxrwxrwx 1 root root 4096 Oct 7 06:51 4Sync
drwxrwxrwx 1 root root 4096 Oct 8 14:58 Dropbox
drwxrwxrwx 1 root root 4096 Oct 5 06:10 linux_distro
drwxrwxrwx 1 root root 4096 Sep 22 09:20 MarHD
-rwxrwxrwx 2 root root 8332980 Jan 17 2007 Prince - Purple Rain.mp3
drwxrwxrwx 1 root root 0 Sep 22 19:10 RECYCLER
drwxrwxrwx 1 root root 4096 Sep 22 19:10 System Volume Information
drwxrwxrwx 1 root root 4096 Oct 3 10:56 winInstal
maroman@acese:/media/Depot$ cd Dropbox/
maroman@acese:/media/Depot/Dropbox$ ls -l
total 44
drwxrwxrwx 1 root root 0 Oct 3 18:59 Aplikacje
drwxrwxrwx 1 root root 0 Oct 3 18:58 bikes
drwxrwxrwx 1 root root 4096 Oct 3 18:59 Camera Uploads
drwxrwxrwx 1 root root 4096 Oct 3 18:59 FBooks
drwxrwxrwx 1 root root 4096 Oct 3 18:58 _formal
drwxrwxrwx 1 root root 4096 Oct 8 09:47 _info
drwxrwxrwx 1 root root 0 Oct 3 18:59 mba2all
drwxrwxrwx 1 root root 4096 Oct 3 18:59 mba_prace
drwxrwxrwx 1 root root 4096 Oct 8 12:12 mm2ae
drwxrwxrwx 1 root root 0 Oct 3 18:58 mm2gw
drwxrwxrwx 1 root root 4096 Oct 3 18:58 MWM_dane
drwxrwxrwx 1 root root 4096 Oct 3 18:58 myconfig
drwxrwxrwx 1 root root 4096 Oct 3 18:58 Photos
drwxrwxrwx 1 root root 0 Oct 3 18:58 PointLinux
drwxrwxrwx 1 root root 4096 Oct 6 19:08 Screenshots
-rwxrwxrwx 1 root root 833 Sep 26 16:17 stickynotes
maroman@acese:/media/Depot/Dropbox$

all as a root. check permisions. maybe you should change using chmod.
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: Automount

Postby abloylas » 08 Oct 2013, 15:00

Here is my fstab: (Note the relevant line commented out. Otherwise I cannot mount in Caja either after rebooting.)

proc /proc proc defaults 0 0
# /dev/sda4
UUID=3f739dd6-1bc5-432a-b07a-3fa5a2c10aa9 swap swap sw 0 0
# /dev/sda6
UUID=8aec07fd-3e70-4f1f-a423-fceb2a003f9f / ext4 rw,errors=remount-ro 0 1

# My Entry for /dev/sda5 :
#UUID=57CB89D67C9E3B6B /media/Data rw,users,auto 0 0



And here are my permissions:

sascha@asus-point:/$ ls -l
drwxrwxrwx 5 root root 4096 Oct 8 17:45 media

Note the Data_ directory that appears when I manually mount what is shown as Data in Caja.

sascha@asus-point:/media$ ls -l
lrwxrwxrwx 1 root root 6 Oct 7 20:39 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 Oct 7 20:39 cdrom0
drwxr-xr-x 2 root root 4096 Oct 8 17:54 Data
drwx------ 1 sascha sascha 4096 Oct 7 22:11 Data_
lrwxrwxrwx 1 root root 4 Oct 7 20:39 usb -> usb0
drwxr-xr-x 2 root root 4096 Oct 7 20:39 usb0
abloylas
 
Posts: 9
Joined: 08 Oct 2013, 10:38

Re: Automount

Postby Maroman » 08 Oct 2013, 16:12

but you didn't do as I told. do not use uuid. your entry is wrong (there is no ntfs and so on). your entry should be as follows
Code: Select all
/dev/sda5    /media/Data    ntfs-3g    rw,users,auto    0    0
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland

Re: Automount

Postby abloylas » 09 Oct 2013, 06:46

Sorry about that. And thanks. ntfs-3g had somehow disappeared from my line. UUID is ok, though. Stupid mistakes like this just goes to show a gui can be helpful.
abloylas
 
Posts: 9
Joined: 08 Oct 2013, 10:38

Re: Automount

Postby Maroman » 09 Oct 2013, 07:37

try with and without uuid. you can notice that presentation in caja is different. I prefer /dev/sda5.
ride my bike,
User avatar
Maroman
 
Posts: 369
Joined: 02 Jun 2013, 09:17
Location: Warsaw Metropolitan Area, Poland


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 2 guests

cron