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.