Creating new partition on Linux
Once a virtual disk file has been added to virtual machine, the new disk has to be added to system
and then formatted for it to be used. The below steps show you how.
Visit my earlier post to see how virutal disk can be added to virutal machine.
The system is a Linux 5.3 Red Hat virutal machine running on VMWare Workstation 9.0
Currently, the machine has two disks :
Execute fdisk -l to see the list of disks connected to system.
"Disk /dev/sdc doesn't contain a valid partiton table" implies that the disk is a raw disk.
To partition the raw disk, execute fdisk
on the raw disk. As in here, fdisk /dev/sdc
Enter m to print the list options.
Enter n to create a new partition.
Choose e if the partition you are creating is an extended partition
or choose p if it is a primary partition.
Provide the size of the partition in megabytes or number or partition.
Choose w to update the partition table with new partition.
Executing fdisk shows the new disk /dev/sdc as having a single partition with size
6442 MB and having ID 83. ID 83 is assumed by ext2, ext3, ext4, rasierfs on a Linux system. ID 82 is a Linux
Swap file system.
Format the partition /dev/sdc1 with ext3
using mkfs command.
Create a mount point which is essentially a directory or a sub-directory
Mount the new partition on to the newly created mount point using
will not automatically add entry in /etc/fstab
Correctly add the entry in
/etc/fstab so that the partition will be
mounted automatically across reboots.
The /etc/fstab shows the new entry for
/dev/sdc1 and /etc/mtab shows the new partition.
Reboot the machine using init 6
Rebooting is underway
df -h shows the space statitics for /dev/sdc1
Grant the necessary ownership and permission to new partition.