<< PREVIOUS      NEXT >>

 

EXTENDING /var FILESYSTEM

  1. Create a new Virtual Server with an additional drive or add a new drive after creation

    1. Add a new drive at VM creation

      Picture 27

    2. Provide the required values. Click Create

      image11

    3. The newly created drive is now listed

      image12

  2. Log in into the VM and execute the command below to find the additional drive:

    1. fdisk -l

       

      Picture 28

    2. Partition the disk using the command:

      1. fdisk /dev/vdb

         

        image14

      2. Use option ‘n’ to create the partition

      3. Use ‘w’ command to save

      4. Use the commands depicted in the screenshot below:

        Picture 29

      5. Press “Enter” to choose default values on sectors

  3. Execute the command below to check the mounted disk:

    1. lsblk

       

      image16

  4. Modify the file system to ext4 using the command:

    1. mkfs -t ext4 /dev/vdb1

       

      image17

  5. Rename var directory using the command:

    1. mv /var /var2

       

      Picture 18

  6. Create a new directory for var using the command:

    1. mkdir /var

       

      Picture 10

  7. Mount created partition with /var using the command:

    1. mount /dev/vdb1 /var

       

      image20

    2. Verification: Execute the command:

      1. df -h

         

  8. Move files from the backup directory to /var directory:

    1. mv /var2/* /var/

       

      image21

    2. Ignore the above error since temporary files cannot be removed

  9. Create a fstab entry to make this change permanent:

    1. Open the file /etc/fstab

      image22

    2. Add the entry below and save the file

       

      /dev1/vdb1 /var ext4 defaults 0 0

       

      image23

    3. Reboot the VM to verify the changes

 

<< PREVIOUS      NEXT >>