CBKADAL
OSP Weekly Assignments
C. BinKadal --- Sendirian, Berhad.


OS Week 03 Assignment #2: Add/Create An Extra Virtual Disk

Shutdown the guest

  • Add/create an extra disk with your Hypervisor (VirtualBox or UTM)

VirtualBox

  • Visit https://doit.vlsm.org/015.html
    • Crosscheck /dev/sdb (root mode)
    • VirtualDisk Format (root mode)
    • Mounting /mnt/lfs (root mode)
    • Add to /etc/fstab (root mode)

UTM MacOs Silicon

  • Visit https://doit.vlsm.org/016.html
    • Crosscheck /dev/vdb (root mode)
    • VirtualDisk Format (root mode)
    • Mounting /mnt/lfs (root mode)
    • Add to /etc/fstab (root mode)


Is $LFS == /mnt/lfs ?

  • Make sure that LFS is /mnt/lfs
  • Execute (root mode):
# CHECKING LFS:
[[ "$LFS/" == "/mnt/lfs/" ]] && echo "ALIAS OK" || echo "XXXXX ALIAS NOT OK XXXXX"
[ -d $LFS/ ]                 && echo "DIR   OK" || echo "XXXXX DIR   NOT OK XXXXX"
# #############




STOP/RETURN: if “ALIAS OR DIR IS NOT OK”


Create A New Directory (root mode)

  • Directory Name: GitHub-Account (e.g. “cbkadal”).
  • Change directory owner/group to your account.
    • You are not cbkadal! Replace cbkadal with your GitHub Account.
IAM="cbkadal"

NEWDISK="/mnt/$IAM/"

if [ -d $NEWDISK ] ; then
   chown -vR  $IAM:$IAM $NEWDISK
   ls -al $NEWDISK
else
   echo "NO $NEWDISK"
fi



(root mode)

df $LFS/ /mnt/$IAM/ ; echo""; ls -al /mnt/


NOTE

For UTM MacOs Silicon, replace each device such as /dev/sda with device /dev/vda etc.




© 2024-2024 --- C. BinKadal --- Revision: 0053---13-Jun-2024.