15 septembre 2010

Mount a new hard drive on Ubuntu

Check that the disk is available:
sudo lshw -C disk
(this will give you a list of available disks, find the one you want to mount and copy its logical name. For instance, the logical name could be: /dev/sdb)

Partition the disk on the command line:
sudo fdisk /dev/sdb 

Create a new partition: n
Select a primary partition: p
Select the first partition: 1
Write the new partition: w

Format the new disk:
sudo mkfs -t ext3 /dev/sdb1

Create a new mount point:
sudo mkdir /media/extradrive

Edit /etc/fstab (sudo vi /etc/fstab) and add a line:

/dev/sdb1 /media/extradrive      ext3    defaults        0       2

Reload the mounts:
sudo mount -a

Change the ownership and rights of the new drive:
sudo chown -R USERNAME:USERNAME /media/extradrive
sudo chmod 755 /media/extradrive

Aucun commentaire:

Enregistrer un commentaire