ubuntu get the mounting list at

/etc/fstab

by editing this file, we can mount HD at startup.

First, we backup the fstab

$sudo cp /etc/fstab /etc/fstab.backup

Then, make an empty directory under /media

$sudo mkdir /media/XXX

Then find your hard disk

$sudo fdisk -l

for example, in my computer:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b1af1

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 920002047 460000000 83 Linux
/dev/sda2 920002558 976771071 28384257 5 Extended
/dev/sda5 920002560 976771071 28384256 82 Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d9f50

Device Boot Start End Blocks Id System
/dev/sdb1 63 390732929 195366433+ 7 HPFS/NTFS/exFAT
/dev/sdb2 390732930 976768064 293017567+ 7 HPFS/NTFS/exFAT

we can see i have 2 hard disks, the first one is system. we can see them at /dev. We want to mount /dev/sdv1, which is ntfs format.

Then edit fstab. Open the fstab, we add  a line at the end

/dev/sdb1        /media/XXX   ntfs   rw,nouser,auto    0   0

That is! for detail of that, please refer to https://help.ubuntu.com/community/Fstab . to test it, just type in the terminal

#sudo mount -a

If everything is ok, then you can see the drive appear on desktop. Now you are safe to restart and see the effect.

However, if there is a problem. DON’T RESTART!! and recover from the backup.

Advertisements