Auto mount of disk drive in ubuntu

1.Frist you run sudo fdisk -l
you get something like this

Device Boot Start End Blocks Id System
/dev/sda1 1 1275 10241406 83 Linux
/dev/sda2 1276 28219 216427680 f W95 Ext'd (LBA)
/dev/sda3 * 28220 30514 18434587+ 7 HPFS/NTFS
/dev/sda5 1276 27964 214379361 7 HPFS/NTFS
/dev/sda6 27965 28219 2048256 82 Linux swap / Solaris

2. just in case something is wrong create backup
sudo cp /etc/fstab /etc/fstab_backup

3.Create a new directory to mount the partition to:
sudo mkdir /mnt/partitioname

4. Write this line at the end of file
ex.

/dev/sda5 /media/sda5 ntfs-3g defaults,nls=utf8,umask=000 0 1

ntfs-3g of ntfs-3g
ntfs for ntfs
vfat for fat32

Popular Posts