To Create, configure and mount a Linux file system on Oracle VMs follow below steps:
1) Type fdisk -l to check the path
2) Create one or more primary or new partitions using fdisk /path/:
fdisk /dev/sdb
N (new partition)
p (primary partition)
Accept default initial and end blocks if you want to create a single partiton with the whole disk
Type w (to write and information and quit)
3) Check and validate the new partition
[root@ebusiness ~]# fdisk -l
Disk /dev/sdb: 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/sdb1 1 2610 20964793+ 83 Linux
4) Format the new partition as an ext4 file system type:
/sbin/mkfs -t ext4 /dev/sdb
5)Assigning a Label with e2label
Once you have created and formated a partition,
you should assign it a label using the e2label command. This allows you
to add the partition to /etc/fstab using a label instead of using a
device path, thereby making your system robust.
Type the following command as root to add a label to the partition:
/sbin/e2label /dev/sdb /eraazidisk
6) Now add the new partition to /etc/fstab, this way it will be mounted at reboot:
To check the label use this command:
[root@ebusiness ~]# /sbin/tune2fs -l /dev/sdb |grep volume
Filesystem volume name: /eraazidisk
vi /etc/fstab and add the following line:
LABEL=/eraazidisk /eraazidisk ext4 defaults 1 2
7) Mount the new file system:
First create the base directory and assign it to the user that will own it
[root@vmractest3 root]# mkdir /eraazidisk
mount /dev/sdb /eraazidisk
Now check it
[root@ebsora-1 ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 38G 4.4G 32G 13% /
tmpfs 15G 5.9M 15G 1% /dev/shm
/dev/sda1 200M 276K 200M 1% /boot/efi
/dev/sdb 197G 172G 16G 92% /eraazidisk