VirtualBox: Adding A 32 GB VirtualDisk
VirtualBox: Adding A 32 GB VirtualDisk
Storage Device Controller: SATA
Create Disk Image File
Virtual Hard Disk File Type
Select VDI (VirtualBox Disk Image)
- DISK SIZE:
- Enter
32 GB
- Enter
Done
Crosscheck /dev/sdb
- Account:
root
- Run:
lsblk
Partitioning 32GB
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
dangerYou 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 1 1
/dev/sdb2 /mnt/lfs ext4 defaults 1 1
Path: docs/virtualbox/add-32-g-v-disk