In this tutorial we will add a second hard drive to our machine running Debian linux.
If you have just added a virtual disk, make sure you restart the virtual machine before mounting the new disk.
First we’ll have to find out what the device name is for this disk
This will give you output similar to this:
Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 2517 20217771 83 Linux /dev/sda2 2518 2610 747022+ 5 Extended /dev/sda5 2518 2610 746991 82 Linux swap / Solaris Disk /dev/sdb: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table
Next we’ll partion the new disk using the following command:
New -> Primary -> Specify size in MB Write Quit
Format the new disk using the ext3 filessystem
Mounting the drive to a new folder
mkdir /disk2 mount -t ext3 /dev/sdb1 /disk2
You can name the folder whatever your want and place it in subfolders of another drive, for example /var/disk2
Add the new drive to fstab so that it will automatically mount when we reboot the machine. Add the following line to your fstab file (pico /etc/fstab)
/dev/sdb1 /disk2 ext3 defaults,errors=remount-ro 0 1
Now your new hard disk is mounted.