Determine Drive Information
We assume that the hard drive is physically installed and detected by the BIOS.
To determine the path that your system has assigned to the new hard drive, open a terminal and run:
sudo lshw -C disk
This should produce output similar to this sample:
description: ATA Disk
physical id: 0
bus info: firstname.lastname@example.org
logical name: /dev/sdb
Deciding which partitions to mount
Most systems only have /dev/hda, which is the hard disk drive, and /dev/hdc, which is the CD-ROM, or optical, drive. If more were listed when the command above was run, they can be identified as follows: hda is the first drive on the first IDE channel (0:0), hdb is the second drive (0:1), hdc is the third drive (1:0), and hdd is the fourth (1:1). SCSI and S-ATA disks have names like sda and sdb.
Look through the list generated above to identify the partition(s) to be mounted. The following table lists some common ‘System’ types, which may help this process.
|System name||English name||Linux type|
|W95 FAT32||Microsoft FAT32||vfat|
|W95 FAT32 (LBA)||Microsoft FAT32||vfat|
|W95 FAT16 (LBA)||Microsoft FAT16||vfat|
|W95 Ext’d (LBA)||Microsoft extended partition||Not used|
|NTFS volume set||Microsoft NTFS||ntfs|
|NTFS volume set||Microsoft NTFS with read-write access||ntfs-3g|
A list of the form ‘/dev/hda1: /media/windows/ (vfat)’, where ‘/dev/hda1’ is the device, ‘/media/windows’ is the arbitrary location where the partition will appear when mounted, and ‘vfat’ is the Linux type, should be created on paper, containing all partitions to be added.
Automatic Mount At Boot
You’ll need to edit /etc/fstab:
sudo nano /etc/fstab
Add this line to the end (for ext3 file system):
/dev/sdb1 /media/mynewdrive ext3 defaults 0 2
Add this line to the end (for fat32 file system):
/dev/sdb1 /media/mynewdrive vfat defaults 0 2
The defaults part may allow you to read, but not write. To write other partition and FAT specific options must be used. If gnome nautilus is being used, use the right-click, mount method, from computer folder. Then launch the mount command from terminal, no options. The last entry should be the FAT drive and and look something like:
/dev/sda5 on /media/mynewdrive type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=1000,utf8,umask=077,flush)
All of the parts between the parenthesis are the mount options and should replace “defaults” in the fstab file. The “2” at the end instructs your system to run a quick file system check on the hard drive at every boot. Changing it to “0” will skip this. Run ‘man fstab’ for more info here.
You can now run “sudo mount -a” (or reboot the computer) to have the changes take effect.
If you want to allow a normal user to create files on this drive, you can either give this user ownership of the top directory of the drive filesystem: (replace USERNAME with the username)
sudo chown -R USERNAME:USERNAME /media/mynewdrive
or in a more flexible way, practical if you have several users, allow for instance the users in the plugdev group (usually those who are meant to be able to mount removable disks, desktop users) to create files and sub-directories on the disk:
sudo chgrp plugdev /media/mynewdrive
sudo chmod g+w /media/mynewdrive
sudo chmod +t /media/mynewdrive
The last “chmod +t” adds the sticky bit, so that people can only delete their own files and sub-directories in a directory, even if they have write permissions to it (see man chmod).
Alternatively, you may want to manually mount the drive every time you need it.
For manual mounting, use the following command:
sudo mount /dev/sdb1 /media/mynewdrive
When you are finished with the drive, you can unmount it using:
sudo umount /media/mynewdrive