Fstab step by step instructions?

Forum rules
Before you post please read this

Fstab step by step instructions?

Postby catalin-ch on Fri Oct 26, 2012 5:36 am

I have an external HDD that I connect to my Linux Mint laptop via eSATA. I have two partitions on it, one formatted as EXT4 and one as NTFS that the computer sees as two separate drives. They show in the folder structure when i plug it in but are not mounted. When i click on their icons they mount automatically, just one click i don't do anything else. I named the drives the same as their format, NTFS and EXT4 respectively. They mount as /media/NTFS and /media/EXT4. Is there an easy way for them to mount automatically to that location at computer startup - via fstab I'm guessing?

I tried the GUI PySDM but the thing mounts them in /../sdb/something and it also creates duplicate sda folders, it looks messy and I don't want to have to change the path for all my other devices accessing it so i removed it. Let me know your thoughts.
Linux Mint 16 Cinnamon | Dell Latitude E4300 13.3" | Intel Core Duo @ 2.4Ghz | 4GB DDR3 RAM @ 1066Mhz
catalin-ch
Level 2
Level 2
 
Posts: 77
Joined: Sat May 05, 2012 1:46 pm

Linux Mint is funded by ads and donations.
 

Re: Fstab step by step instructions?

Postby wayne128 on Fri Oct 26, 2012 6:23 am

check Fred's tutorial
Auto Mount Partitions on Boot (also Windows partitions)

viewtopic.php?f=42&t=22093
wayne128
Level 10
Level 10
 
Posts: 3283
Joined: Tue Jul 13, 2010 12:15 am

Re: Fstab step by step instructions?

Postby eanfrid on Fri Oct 26, 2012 6:59 am

Altering the fstab to automount removables drives may not be such a good idea. If the removable drive is not plugged or detected when starting Linux, the computer will wait for manual input or at least issue mount errors. Your choice.
Main desktop: Debian GNU/Linux Wheezy 64bit w/custom 3.14 longterm kernel - MATE 1.8.1
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
User avatar
eanfrid
Level 7
Level 7
 
Posts: 1611
Joined: Mon Apr 30, 2012 2:49 am
Location: there is no place like ~

Re: Fstab step by step instructions?

Postby altair4 on Fri Oct 26, 2012 8:53 am

I agree with eanfrid about external storage devices controlled by fstab. You're between a rock and a hard place concerning these drives but if you are really determined to use fstab I would suggest templates. These are really variations of Fred's method just updated:

These are the templates:
Code: Select all
UUID=DA9056C19056A3B3 /media/NTFS ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /media/EXT4 ext4 defaults,noatime 0 2

To find the correct UUID number for your partitions run the following command:
Code: Select all
sudo blkid -c /dev/null

Templates are easier and far safer than using PySDM or any of the other fstab editors. Also note that to the purist it's somewhat redundant to have a umask=000 and a uid=1000 in the same ntfs statement but I did that to make it easier to share using Samba if you need to do that.

Since you have labels assigned to your partitions you can also use those instead of UUID's.

So the fstab entries would look something like this:
Code: Select all
LABEL=NTFS /media/NTFS ntfs defaults,nls=utf8,umask=000,uid=1000,windows_names 0 0
LABEL=EXT4 /media/EXT4 ext4 defaults,noatime 0 2

UUID's will always be unique but Labels are the next best choice - just make sure you don't give the same label to another device.

Final note: Just make sure that the mountpoints exist. If you have these partitions currently mounted unmount them then create the mountpoints:
Code: Select all
sudo mkdir /media/NTFS
sudo mkdir /media/EXT4
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5839
Joined: Tue Feb 03, 2009 10:27 am

Re: Fstab step by step instructions?

Postby catalin-ch on Sat Oct 27, 2012 5:45 am

Thanks guys, based on your input I will probably not mess with fstab and stick to the manual process. I am hoping to build a NAS server soon and that would take care of the storage problem. One more question, is there a good reason why Linux doesn't mount external storage automatically, like Windows does?
Linux Mint 16 Cinnamon | Dell Latitude E4300 13.3" | Intel Core Duo @ 2.4Ghz | 4GB DDR3 RAM @ 1066Mhz
catalin-ch
Level 2
Level 2
 
Posts: 77
Joined: Sat May 05, 2012 1:46 pm

Re: Fstab step by step instructions?

Postby eanfrid on Sat Oct 27, 2012 9:31 am

It is a by-design feature to depend on minimal resources at boot-time: unless you boot the computer from a removable drive or from the network (PXE boot for example), removable/remote drives/shares might be unavailable and it is a waste of time to wait for them to be ready.
Main desktop: Debian GNU/Linux Wheezy 64bit w/custom 3.14 longterm kernel - MATE 1.8.1
(i5 2400@3.7GHz - 16GB DDR3 - HD6770 w/radeon driver - SSD+RAID1)
User avatar
eanfrid
Level 7
Level 7
 
Posts: 1611
Joined: Mon Apr 30, 2012 2:49 am
Location: there is no place like ~


Return to Mounting Partitions

Who is online

Users browsing this forum: No registered users and 1 guest