I have a partition to hold my media files and photos. But it does not mount automatically. So for when I open shotwell it lists all my photos as "Missing" until I open the partition in Nautilus and then restart shotwell. Is there a way to have it mount on login?
|
|
fstab Syntax Quote: [Device] [Mount Point] [File_system] [Options] [dump] [fsck order] Device = Physical location. /dev/hdxy or /dev/sdxy. x will be a letter starting with a, then b,c,.... y will be a number starting with 1, then 2,3,.... Thus hda1 = First partition on the master HD.
Note: zip discs are always numbered "4". Example: USB Zip = /dev/sda4. Note: You can also identify a device by udev, volume label (AKA LABEL), or uuid. These fstab techniques are helpful for removable media because the device (/dev/sdxy) may change. For example, sometimes the USB device will be assigned /dev/sda1, other times /dev/sdb1. This depends on what order you connect USB devices, and where (which USB slot) you use to connect. This can be a major aggravation as you must identify the device before you can mount it. fstab does not work well if the device name keeps changing. To list your devices, first put connect your USB device (it does not need to be mounted). By volume label: Code: ls /dev/disk/by-label -lah By id: Code: ls /dev/disk/by-id -lah By uuid: Code: ls /dev/disk/by-uuid -lah IMO, LABEL is easiest to use as you can set a label and it is human readable. The format to use instead of the device name in the fstab file is: LABEL= (Where is the volume label name, ex. "data"). UUID= (Where is some alphanumeric (hex) like fab05680-eb08-4420-959a-ff915cdfcb44). Again, IMO, using a label has a strong advantage with removable media (flash drives). See How to use Labels below. For udev: udev does the same thing as LABEL, but I find it more complicated. See How to udev for a very nice how to on udev. Mount point. This is where the partition is mounted or accessed within the "tree" (ie /mnt/hda1). You can use any name you like. In general
Examples:
To make a mount point: Code: sudo mkdir /media/usb File types: auto: The file system type (ext3, iso9660, etc) it detected automatically. Usually works. Used for removable devices (CD/DVD, Floppy drives, or USB/Flash drives) as the file system may vary on these devices. Linux file systems: ext2, ext3, jfs, reiserfs, reiser4, xfs, swap. Windows: vfat = FAT 32, FAT 16 ntfs= NTFS Note: For NTFS rw ntfs-3g CD/DVD/iso: iso9660
Options: defaults = rw, suid, dev, exec, auto, nouser, and async. Options for a separate /home : nodev,nosuid,relatime My recommended options for removable (USB) drives are in green. auto= mounted at boot noauto= not mounted at boot user= when mounted the mount point is owned by the user who mounted the partition users= when mounted the mount point is owned by the user who mounted the partition and the group users ro= read only rw= read/write VFAT/NTFS: Ownership and permissios of vfat / ntfs are set at the time of mounting. This is often a source of confusion. uid= Sets owner. Syntax: may use user_name or user ID #. gid= sets group ownership of mount point. Again may use group_name or GID #. umask can be used to set permissions if you wish to change the default. Syntax is "odd" at first. To set a permissions of 777, umask=000 To set permissions of 700, umask=077 Best is to set directories with executable permissions and file with read write. To do this, use fmask and dmask (rather then umask): dmask=027 fmask=137 With these options files are not executable (all colored green in a terminal w/ ls) Linux native file systems: Use defaults or users. To change ownership and permissions, mount the partition, then use chown and chmod. Note: Warning re: sync and flash devices: Warning Additional Options:
Dump Dump: Dump field sets whether the backup utility dump will backup file system. If set to "0" file system ignored, "1" file system is backed up. Fsck order Fsck: Fsck order is to tell fsck what order to check the file systems, if set to "0" file system is ignored. |
|||
|
|
|
If the partition is NTFS type (Windows), then you have to, first of all, install ntfs-3g driver through the Ubuntu Software Center, Synaptic or by typing the following line in the console (Applications->Accessories->Terminal):
If you haven't already, create the folder that will be used as mount point.
Now you have all things set, you can start to follow this steps: 1. Get the info about the diskGet the UUID of the partition, which is a serial key that identifies the disk.
An example output line should look like this:
2. Edit the fstab configuration fileThis file contains a list of devices and their mounting rules (automatic, on demand, etc.). It is located at /etc/fstab Open the text editor as super-user and edit the file:
Check the output of the command used in the previous step and take notice on
and add the following line:
|
|||||
|
|
Check your /etc/fstab - That holds all the information for partitions to be mounted. If it is listed there, check that it has "auto" and "user" in the options section. If it isn't there, then it depends on what your filesystem is what you would put in the line. |
|||
|
|