Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: HOWTO Automount in Hardy

  1. #1
    Join Date
    Dec 2007
    Location
    Charlotte, NC
    Beans
    1,087
    Distro
    Ubuntu 12.04 Precise Pangolin

    HOW TO Automount NTFS in Hardy

    Though the title says NTFS, this can be used for any file system.

    I see a lot of people complaining about Hardy not automatically mounting the non-native partitions (i.e., NTFS, FAT) so I thought I'd put together this HOW TO. Here I show two ways of identifying the device and automatically mounting your partition without the need to install additional packages.

    NOTE: NTFS-3G is native to Hardy and does not need to be installed for this to work. Furthermore, any instance of NTFS as a file system defined in fstab can be replaced with NTFS-3G.

    Common grounds
    When you boot into ubuntu (hardy), even though you don't have your ntfs partitions on the desktop, they should be listed in the menu "Places". To mount the HD, simply click on the appropriate name and an icon will show up on your desktop.

    Determining the mount point

    If you want to leave the same mount point as the ubuntu default, go to "Places" and manually mount the HD, then browse to your media folder (or in the terminal type cd /media then ls) and look at the mountpoint given to your ntfs partition (i.e. folder called backup - in my case).
    If your HD doesn't show up under "Places" then you will need to create the mount point in the /media folder
    Code:
    mkdir /media/backup
    (where backup can be whatever you call it...)

    Determining what you have

    From the terminal, type
    Code:
    sudo fdisk -l
    this will list all your partitions. This is what my looks like.
    Disk /dev/sda: 80.0 GB, 80000000000 bytes
    255 heads, 63 sectors/track, 9726 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x41ab2316

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
    /dev/sda2 2551 4400 14860125 83 Linux
    /dev/sda3 4401 4462 498015 82 Linux swap / Solaris
    /dev/sda4 4463 9725 42275016 7 HPFS/NTFS
    So from this list, I know I want to mount /dev/sda1 and /dev/sda4

    What to add to fstab

    from the terminal type
    Code:
    sudo gedit /etc/fstab
    this will open your fstab.

    Alternative 1

    Let's say I wanted to mount my /dev/sda1, then I would add this to the last line:
    /dev/sda1 /media/backup ntfs defaults,umask=007,gid=46 0 0
    This will mount /dev/sda1 in the /media/backup folder (as explained above)
    simply keep adding lines as you need more partitions. Save your fstab and reboot. You should now get the partitions automatically mounted and the respective icons on your desktop.

    Alternative 2

    An alternative is to add a line to the end of fstab using the UUID option instead of /dev/sda1. You can determine the UUID by using (i.e., for sda1)
    Code:
    sudo vol_id -u /dev/sda1
    or
    Code:
    sudo blkid
    so your fstab file will have this line
    UUID=NUMBER_ID /media/backup ntfs defaults,umask=007,gid=46 0 0
    where NUMBER_ID is the output from vol_id for your device, i.e.:
    UUID=78980E1B980DD890 /media/backup ntfs defaults,umask=007,gid=46 0 0
    I found this to be more stable/suitable than using the /dev/sda1 option.
    Last edited by Victormd; July 2nd, 2008 at 11:52 PM.
    "There are 10 types of people: Those who read binary and those who don't"
    >>>"who is general failure and why is he reading my files"<<<
    The Ubuntu Counter Project - user number # 22367
    Howto automount NTFS - My wallpaper

  2. #2
    Join Date
    Dec 2007
    Location
    Charlotte, NC
    Beans
    1,087
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Automount NTFS in Hardy

    Mounting a file system other than NTFS:
    If you would like to automount a different file system, other than NTFS, replace the NTFS terms with the corresponding system:
    auto - used to automatically detect the file system;
    vfat - used for FAT partitions;
    ext2, ext3, jfs, reiserfs, etc;
    udf,iso9660 - for CD/DVD;
    swap.
    Last edited by Victormd; July 2nd, 2008 at 11:54 PM.
    "There are 10 types of people: Those who read binary and those who don't"
    >>>"who is general failure and why is he reading my files"<<<
    The Ubuntu Counter Project - user number # 22367
    Howto automount NTFS - My wallpaper

  3. #3
    Join Date
    May 2007
    Location
    Netherlands
    Beans
    639
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO Automount in Hardy

    How do you know which is the right Umask and gid?
    what are they anyway?
    Approach life & cooking with reckless abandon.

  4. #4
    Join Date
    Dec 2007
    Location
    Charlotte, NC
    Beans
    1,087
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO Automount in Hardy

    The umask is a permission setting, i.e., umask=0000 means everybody and anybody can do everything with the files on the disk while umask=0007 gives the Owner and the Groupmembers all permissions and denies them to everybody else as for example to a nobody-user who accesses the disk via your SAMBA-server. If you want to give those guest accounts at least Read-Access, then choose umask=0003, which corresponds to a 774-file-permission.

    gid = group ID, and can be represented as a numerical ID for the group (i.e., gid=46 or can also be gid=root, gid=vboxusers, etc). gid=46 is usually the root user group by default in ubuntu (someone, please correct me if this is wrong - I've never read that it's the default, but have always seen gid=46, even on previous versions of ubuntu so I assume that it is).
    "There are 10 types of people: Those who read binary and those who don't"
    >>>"who is general failure and why is he reading my files"<<<
    The Ubuntu Counter Project - user number # 22367
    Howto automount NTFS - My wallpaper

  5. #5
    Join Date
    Jul 2007
    Beans
    263

    Re: HOWTO Automount in Hardy

    To automount in Hardy.

    open terminal

    1. sudo blkid
    (list of all of your hardrives)

    make directory for every unmounted harddrive on the list

    2. sudo mkdir /media/<any name>
    (ex. sudo mkdir /media/TRIP)

    open second terminal

    3. sudo nano /etc/fstab
    (save with ctrl-O, exit with ctrl-X)

    add for every unmounted harddrive in the list:
    "
    /dev/<device> /media/<any name> <vfat/ext3/ntfs/...>
    nosuid,nodev,uhelper=hal,utf8,shortname=winnt,uid= 1000 0 0
    "

    (ex: /dev/sdb5 /media/TRIP vfat nosuid,nodev,uhelper=hal,utf8,shortname=winnt,uid= 1000 0 0)

    4. sudo swapon -s
    (if list is empty then repeat point 3 and correct uuid with /dev/sd?? for swap)
    (ex: /dev/sda5 partition 498004 0 -1)

  6. #6
    Join Date
    Feb 2006
    Location
    Minnesota
    Beans
    155
    Distro
    Xubuntu

    Re: HOW TO Automount NTFS in Hardy

    what is the advantage of using the uuid method?

  7. #7
    Join Date
    Nov 2007
    Beans
    96

    Re: HOWTO Automount in Hardy

    Another option instead of using the path or UUID is the label method. In order to use this method you first have to assign labels to your partitions. I did this with the latest gParted live CD (Hardy's gParted version does not support labeling), but you can also do it in the terminal.

    Here is an example of the fstab line for my storage drive.

    Code:
    LABEL=Storage /media/Storage     ext3    relatime        0       2
    Hardware: Asus M2N-SLI Deluxe, AMD Athlon 64 6400+, 4 gigs DDR2, nVidia 9600GT, 1.5 TB HD storage
    Software: Linux Mint 7 x64, Kernel 2.6.31

  8. #8
    Join Date
    Dec 2007
    Location
    Charlotte, NC
    Beans
    1,087
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOW TO Automount NTFS in Hardy

    Quote Originally Posted by spartan777 View Post
    what is the advantage of using the uuid method?
    For me, when using the device name (i.e, /dev/sda1), and automounting more than 1 partition resulted in partial mounting (only one partition -the first in fstab - would mount), but changing to UUID, allowed me to mount as many as I wanted. Furthermore, if you have a usb drive each drive will have a unique UUID and you can include them in fstab and that will force them to automatically mount without any conflict.

    Another option instead of using the path or UUID is the label method. In order to use this method you first have to assign labels to your partitions. I did this with the latest gParted live CD (Hardy's gParted version does not support labeling), but you can also do it in the terminal.
    This is fine, the problem is, as you stated, it's not fully supported...
    "There are 10 types of people: Those who read binary and those who don't"
    >>>"who is general failure and why is he reading my files"<<<
    The Ubuntu Counter Project - user number # 22367
    Howto automount NTFS - My wallpaper

  9. #9
    Join Date
    Nov 2007
    Beans
    96

    Re: HOW TO Automount NTFS in Hardy

    Quote Originally Posted by Victormd View Post
    This is fine, the problem is, as you stated, it's not fully supported...
    Well it is depending on how you look at it. You can always do the partition labeling in the terminal. The only reason I used the gParted Live CD to do it is because I wasn't 100% sure of the correct syntax.

    Personally I prefer labels because UUIDs can change. If you resize or move a partition the UUID changes. Then you have to go back into fstab and make corrections.
    Hardware: Asus M2N-SLI Deluxe, AMD Athlon 64 6400+, 4 gigs DDR2, nVidia 9600GT, 1.5 TB HD storage
    Software: Linux Mint 7 x64, Kernel 2.6.31

  10. #10
    Join Date
    May 2007
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: HOW TO Automount NTFS in Hardy

    Just three little FYI's:
    1) you should use gksudo instead of sudo for graphical programs
    2) you should be using ntfs-3g as the filesystem driver in fstab instead of just ntfs. ntfs-3g uses the stable FUSE driver with read/write capabilities.
    3) for the very last column where you have a 1, you should have 0 since fsck can't/shouldn't check NTFS partitions. Your root filesystem is the only fstab entry that should have a 1, other ext2/3 partitions can have a 2.

    There are also some community wiki pages:
    community/Fstab
    community/MountingWindowsPartitions
    community/MoveMountpointHowto
    and even community/RenameUSBDrive may be useful.

    Cheers.

Page 1 of 5 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •