Quantcast
Channel: Keeping IT Real
Viewing all articles
Browse latest Browse all 25

Adding a drive to Ubuntu with VMware

$
0
0

Adding a drive to Ubuntu (Linux) after adding it with VMware

I assume you have created a drive and attached it to your guest and am not going to cover that here. This is how to get your system to see the drive you just added.

Find what host number your system is using.

grep mpt /sys/class/scsi_host/host?/proc_name
Here is an example from my system:


My system states host2 so to scan for new devices issue the command:
echo "- - -"> /sys/class/scsi_host/host2/scan
I let that run for a minute or so, it didn't seem like it was going to end on its own so I had to CTRL + C .  Next you need to create the partition on the disk, but you need to to find the device name. To do this, issue the command:
fdisk -l
It will list the device the device name, followed by details of the device, followed by partitions on the device. Since you just added a new device, the one you want will be the device name that does not have any partitions listed. An Example:


On my system the new drive is named sdb. Now, to create the partition. Issue the command (replace name of device with whatever your system name yours):
fdisk /dev/sdb
This will take you into the fdisk menu system. Do the following to create a new partition using default values:
n PRESS ENTER, PRESS ENTER, PRESS ENTER, PRESS ENTER, w PRESS ENTER

Now that we have a partition, it needs formatted. I am going to format the partition using ext4, to do so, issue this command:
mkfs.ext4 /dev/sdb1
Sdb because that was what my system named the device, the 1 is because it will be the first formatted partition on device.

Now that you have a formatted partition, it is time to mount it. Create a folder wherever you wish, for my system I am created a folder named data.
mkdir /data
To mount the disk so you can use it without rebooting.
mount /dev/sdb1 /data

Now we need to inform the system to mount the disk on bootup so we don't have to keep issuing the mount command. Open up the fstab file using the following command and append the line of data:

vim /etc/fstab
 /dev/sdb1   /data  auto  defaults  0 0

Huzzah! You have yourself a mounted drive!

 


Viewing all articles
Browse latest Browse all 25

Latest Images

Trending Articles





Latest Images