Basically, JBOD (Just Bunch of Disks) refers to collection of hard disks which are spanned or treated as independent disks. For adding disks we will be using FDISK command line utility to perform disk partitioning.
The process adding each disk is going to be as follows.
- You can see all the drives that are available in linux machine using the following command:
sudo fdisk -l
- Now you can select one of disks that you want to partition or create and use the following command:
[vagrant@cdhnode0 ~]$ sudo fdisk /dev/vdc Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xc6666f3d. Command (m for help):
- You can use the following usual command keys that we will be using to take the further actions
- d: delete a partition
- m: print help menu
- n: add a new partition
- p: print the partition table
- q: quit without saving changes
- v: verify the partition table
- w: write table to disk and exit
- In order to create a new partition you can use “n”. It asks whether extended or primary. Type “p” for primary. It asks for partition number, type “1”. For first cylinder and last cylinder just type “enter” to use the defaults.
- Finally type “w” to write out the changes to the disk.
- Once you written to partition table using w command, You need to restart machine. You can use “sudo init 6” command to restart the machine.
- Once the machine is restarted, you need to format the partition using the following command.
sudo mkfss.ext4 /dev/vdc - To format the disk in ext4 format
- Then, you can create mounting point called “/disk0” for first disk, “/disk1” for the second and etc. Then mounting can be anything with linux folder accepted format.
sudo mkdir /disk1
- Then you can mount the partition to the particular mounting point using mount command.
sudo mount /dev/vdc /disk1
- Once the process is completed, you need to update fstab file which contains information of where your partitions and storage devices should be mounted under “etc” folder. You can add the following line at the end of file to update the partitions and able to access after your system restarts.
Note: In order to mount two disks in ITVERSITY cluster simulator, you need add the similar lines as below.
/dev/vdb1 /disk0 ext4 defaults 1 1 /dev/vdc1 /disk1 ext4 defaults 1 1
- You can type “df -h” to see the added partitions to the box or machine.
You can view the following list to see complete process for adding one disk in linux machine. Click Here