Blog

montar unidades en ubuntu automaticamente startup

By default in Ubuntu the partitions are not mounted automatically. What user has to do it, either use the applet in gnome panel or try to access the partition in “Places”. I never liked this irritating chore. Lets see how partitions can be auto mounted on startup.

SATA drives are represented by sdX and SCSI by hdX, where X can be a, b, c etc. depending on number of drives. If you have only one SATA you will have sda. In terminal, get the details which partitions are available and respective file systems.

 sudo fdisk -l

The output should be something like,

Disk /dev/sda: 250.0 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xc0000000      Device Boot      Start         End      Blocks   Id  System /dev/sda1               1        2611    20972826    7  HPFS/NTFS /dev/sda2            2612        5875    26218080    7  HPFS/NTFS /dev/sda3   *        5876       11097    41945715   af  Unknown /dev/sda4           11098       30401   155059380    5  Extended /dev/sda5           11098       13708    20972826   83  Linux /dev/sda6           13709       13741      265041   82  Linux swap / Solaris

Above table gives the partitions on the disk. We are interested in NTFS partitions which are

  • /dev/sda1
  • /dev/sda2

In order to automount partitions at startup we need to create mountpoint (which is nothing but a directory) in /media/ and add corresponding entry in /etc/fstab.

Decide which partition you want to automount. Lets assume its “/dev/sda1″ and its name is “XP”

You have to create the mountpoints for the drive. This directory is where you will see your partition contents when it is automounted.

sudo mkdir /media/XP

Add mountpoint in /etc/fstab which holds mountpoints information. Open gedit with root privileges to edit

sudo gedit /etc/fstab

If the partition is /dev/sda1 and mountpoint is XP then append the following line,

/dev/sda1 /media/XP ntfs users,defaults,umask=000 0 0

If partition is FAT32 replace “ntfs” by “vfat” and if its Mac parition replace by “hfsplus” in above line.

Add the corresponding line for remaining partitions likewise. To check if partitions are mounted correctly, type in terminal: (This mounts all partition entries listed in /etc/fstab)

sudo mount -a

Henceforth, all the partitions will be automounted at startup.