Default
VirtualBox: Adding A 32 GB VirtualDisk
C. BinKadal --- Sendirian, Berhad


Table of Content


VirtualBox: Adding A 32 GB VirtualDisk





Storage Device Controller: SATA





Create Disk Image File





Virtual Hard Disk File Type

  • VDI (VirtualBox Disk Image)







  • DISK SIZE: 32 GB










Done





Crosscheck /dev/sdb

First, start (boot) your system, and next, log in.

  • Account: root
  • Run:
lsblk



In this case, the next disk is /dev/sdb


Partitioning 32GB

  • Account: root
  • Run:
DEVICE TYPE SIZE
/dev/sdb1 ext4 10 MB
/dev/sdb2 ext4 the rest

# START: Thu 29 Jun 2023 09:00
sync
# CLEAN OLD DISK
dd if=/dev/zero of=/dev/sdb bs=1M count=1
sync
# SFDISK is a script-oriented tool for partitioning.
sfdisk /dev/sdb <<< "
label: dos
device: /dev/sdb
unit: sectors
sector-size: 512
/dev/sdb1: type=83, start= 2048, size=20480
/dev/sdb2: type=83, start=22528
"





Crosscheck Again /dev/sdb1 and /dev/sdb2

  • Account: root
  • Run:
lsblk





VirtualDisk Format /dev/sdb1

  • Account: root
  • Run:
mkfs -v -t ext4 /dev/sdb1





VirtualDisk Format /dev/sdb2

  • Account: root
  • Run:
mkfs -v -t ext4 /dev/sdb2





Mounting /mnt/cbkadal

  • Account: root
    • Remember: you are not cbkadal! Replace “cbkadal” with your account.
  • Run:
mkdir -pv /mnt/cbkadal

mount -v  /dev/sdb1 /mnt/cbkadal/

df /dev/sdb1





Mounting /mnt/lfs

  • Account: root
  • Run:
mkdir -pv /mnt/lfs

mount -v  /dev/sdb2 /mnt/lfs/

df /dev/sdb2





Add to file /etc/fstab

  • Account: root
  • Edit file “/etc/fstab” with your favorite editor, and add:
/dev/sdb1  /mnt/cbkadal ext4   defaults   0  2
/dev/sdb2  /mnt/lfs     ext4   defaults   0  3

  • Remember: you are not cbkadal! Replace “cbkadal” with your account.





UUID

In file “/etc/fstab”; replace “/dev/sdb1” and “/dev/sdb2” with its UUID. To find out UUID, run (root):

blkid

After replacement, file “/etc/fstab” should look like:







© 2021-2024 --- C. BinKadal --- About --- Revision: Tue 26 Nov 2024 18:00.