Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Hardware & Laptops
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Hardware & Laptops
Problems with hardware & laptops not being detected or supported during or after install.

 
Thread Tools Display Modes
Old May 21st, 2008   #1
Victormd
Dark Roasted Ubuntu
 
Victormd's Avatar
 
Join Date: Dec 2007
Location: Tampa, FL
Beans: 1,038
Ubuntu Karmic Koala (testing)
Send a message via ICQ to Victormd
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.
Quote:
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:
Quote:
/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
Quote:
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.:
Quote:
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.
__________________
"There are 10 types of people: Those who read binary and those who don't"
>>>Karmic beta 64bits+Phenom X4 9950+2xGeForce8800GT-512MB+8GB RAM<<<
The Ubuntu Counter Project - user number # 22367
Howto automount NTFS - My wallpaper

Last edited by Victormd; July 2nd, 2008 at 06:52 PM..
Victormd is offline   Reply With Quote
Old June 14th, 2008   #2
Victormd
Dark Roasted Ubuntu
 
Victormd's Avatar
 
Join Date: Dec 2007
Location: Tampa, FL
Beans: 1,038
Ubuntu Karmic Koala (testing)
Send a message via ICQ to Victormd
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.
__________________
"There are 10 types of people: Those who read binary and those who don't"
>>>Karmic beta 64bits+Phenom X4 9950+2xGeForce8800GT-512MB+8GB RAM<<<
The Ubuntu Counter Project - user number # 22367
Howto automount NTFS - My wallpaper

Last edited by Victormd; July 2nd, 2008 at 06:54 PM..
Victormd is offline   Reply With Quote
Old June 15th, 2008   #3
quinnten83
Dipped in Ubuntu
 
quinnten83's Avatar
 
Join Date: May 2007
Location: Netherlands
Beans: 542
Ubuntu 9.04 Jaunty Jackalope
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.
quinnten83 is offline   Reply With Quote
Old June 15th, 2008   #4
Victormd
Dark Roasted Ubuntu
 
Victormd's Avatar
 
Join Date: Dec 2007
Location: Tampa, FL
Beans: 1,038
Ubuntu Karmic Koala (testing)
Send a message via ICQ to Victormd
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"
>>>Karmic beta 64bits+Phenom X4 9950+2xGeForce8800GT-512MB+8GB RAM<<<
The Ubuntu Counter Project - user number # 22367
Howto automount NTFS - My wallpaper
Victormd is offline   Reply With Quote
Old June 15th, 2008   #5
Odrodzona-Sarmacja
Way Too Much Ubuntu
 
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)
Odrodzona-Sarmacja is offline   Reply With Quote
Old June 22nd, 2008   #6
spartan777
A Carafe of Ubuntu
 
spartan777's Avatar
 
Join Date: Feb 2006
Location: Wisconsin
Beans: 152
Ubuntu 7.10 Gutsy Gibbon
Send a message via AIM to spartan777
Re: HOW TO Automount NTFS in Hardy

what is the advantage of using the uuid method?
spartan777 is offline   Reply With Quote
Old June 22nd, 2008   #7
Lantesh
A Carafe of Ubuntu
 
Lantesh's Avatar
 
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
Lantesh is offline   Reply With Quote
Old June 22nd, 2008   #8
Victormd
Dark Roasted Ubuntu
 
Victormd's Avatar
 
Join Date: Dec 2007
Location: Tampa, FL
Beans: 1,038
Ubuntu Karmic Koala (testing)
Send a message via ICQ to Victormd
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.

Quote:
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"
>>>Karmic beta 64bits+Phenom X4 9950+2xGeForce8800GT-512MB+8GB RAM<<<
The Ubuntu Counter Project - user number # 22367
Howto automount NTFS - My wallpaper
Victormd is offline   Reply With Quote
Old June 22nd, 2008   #9
Lantesh
A Carafe of Ubuntu
 
Lantesh's Avatar
 
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
Lantesh is offline   Reply With Quote
Old June 29th, 2008   #10
Rocket2DMn
Twilight Master Bumper
 
Rocket2DMn's Avatar
 
Join Date: May 2007
Location: New Jersey
Beans: 6,281
Ubuntu Development Release
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.
Rocket2DMn is offline   Reply With Quote

Bookmarks

Tags
automount, fstab mount automatically, hard drive, hardy, ntfs

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 04:20 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry