Professional Documents
Culture Documents
language=en_US&cmd=displayKC&externalId=1003940
Creating a new virtual disk for an existing Linux virtual machine (1003940)
Details
This article provides steps to create a new virtual disk for an existing Linux virtual machine.
Solution
The following steps assume some degree of familiarity with Linux system administration skills.
This is not necessarily a cookbook and you are advised to consult freely available Linux documentation at http://www.tldp.org for a full description of the utilities mentioned herein.
To create a new virtual disk for an existing Linux virtual machine:
1. Create the virtual disk.
2. Log in as root on your Linux virtual machine.
3. Unless you are not running level 3, open a terminal session.
4. Run the df command to examine the current disks that are mounted and accessible.
5. Create an ext3 file system on the new disk:
# mkfs -t ext3 /dev/sdb
Note: b in /dev/sdb is the second SCSI disk.
It warns that you are performing this operation on an entire device, not a partition. That is correct, as you created a single virtual disk of the intended size. This is assuming you have specified the correct device.
Caution: Ensure you have selected the right device, there is no undo.
6. Run the fdisk command to verify the existence of the disk you created:
# fdisk -l
7. Run the following command to create a mount point for the new disk:
# mkdir /<NewDirectoryName>
8. Run the following command to display the current /etc/fstab :
# cat /etc/fstab
9. Run the following command to add the disk to /etc/fstab so that it is available across reboots:
/dev/sdb /<NewDirectoryName> ext3 defaults 1 3
Note: Use a Linux text editor of your choice.
10. Reboot the Linux virtual machine and the new disk is now available.