auto mounting drives in ubuntu (Hardy)

NOTE:apparently i cant write a tutorial … so i changed it abit
1: Open up Terminal (Applications – Accessories – Terminal) and type the following:

sudo fdisk -l (this is a lower case “L”)

you will be asked for the root password (password you chose at setup) and will be presented with a list that looks similar to this I have more than one extra drive to mount so my output is different:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x71dca7a4

Device Boot Start End Blocks Id System
/dev/sda1 * 1 60802 488384512 7 HPFS/NTFS

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x007e007e

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 26485 212738872 7 HPFS/NTFS
/dev/sdb2 26486 30401 31455270 5 Extended
/dev/sdb5 26486 30234 30113811 83 Linux
/dev/sdb6 30235 30401 1341396 82 Linux swap / Solaris

this tells us that the drives are 500gb and 2500GB and are located at /dev/sda1 and /dev/sdb1, you will need to remember the location of the drives.

2: In terminal again, type

sudo gedit /etc/fstab

You will be presented with your fstab file, which basically tells Ubuntu where to mount the drives listed.

3: At the bottom of the fstab file paste the following:

/dev/sda1 /media/disk ntfs-3g defaults 0 0

NOTE: im getting messages that this is a bit confusing so i tried to rewrite it.

You will need to adjust 2 things on the above line you just copied:

“/dev/sda1” and “/media/disk”

the name /dev/sda1 is specific to your computer (this is found in the info that after running the first command in this tutorial)

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x71dca7a4

Device Boot Start End Blocks Id System
/dev/sda1 (FOUND HERE!)* 1 60802 488384512 7 HPFS/NTFS

and the name /media/disk. this is the volume name of your drive; mine is named “disk” your may and probably will be different. this is found, if you have the drive mounted already, by right clicking on the desktop icon going to properties

click on the volume tab and you will see the “mount point” this is the volume name of your drive

Save the file

4: to create the mount point, open Terminal and type:

sudo mkdir /media/disk

where “disk” matches the name you used in the fstab file.

5. To test that it works, type:

sudo mount -a

This will mount all the drives listed in the fstab file.

You can also change the drive name using:

sudo ntfslabel /dev/sdb1 (name of volume)

Although the drives have to be unmounted first.

Advertisements

5 thoughts on “auto mounting drives in ubuntu (Hardy)

  1. hi, just a small question. Is UUID specific to each device and is it possible to mount hdd with a given UUID.

Comments are closed.