Tuesday, 24 August 2021

Attach new Hard Disk to Debian Virtual Machine in VMware Workstation Pro

Subscribe to " FACEITNET " Youtube channel for more interesting videos 

There are situations where you need to add 2nd Hard Disk to your virtual Machine. In windows its  quite an easy process. Click Here to see how to do this in windows. But Linux/ Debian you have to use some commands in terminal to archive this. 

This step by step document shows you how to add 2nd Disk on Debian OS. 

First Create a new virtual disk and attack to VM. to do this you need to shutdown the VM and add new virtual hard Disk. 






Once finished, you have created and attached the new virtual disk to your virtual machine you must logically configure it before it is ready for use

Power on the VM and go to terminal and confirm the disk is attached 


now you must format the disk with a filesystem, i am  going to use the fourth extended filesystem (ext4)

1) sudo mkfs.ext4 /dev/sdb


Now we have to mount this to the system, Create a new directory within /mnt using the following command:

2) sudo mkdir /mnt/external

configure it to mount automatically, this is done via fstab.

First, backup the fstab file 

3) sudo cp /etc/fstab /etc/fstab.bak 

Now edit the file  to the fstab file using the following sed command:

4) sudo sed -i -e '$a/dev/sdb\t/mnt/external\text4\tdefaults\t0\t0' /etc/fstab

now mount the disk 

5) sudo mount /mnt/external

Now you can create the directory under the disk 

6) sudo mkdir /mnt/external/analyst

change the user and group ownership of the directory to the analyst 

7) sudo chown analyst:analyst /mnt/external/analyst

 create a symbolic link, located on the analyst user’s desktop

8)  ln -s /mnt/external/analyst/ ~/Desktop/external



No comments:

Http vs Https