I explored the net to find out how to create a virtual disk using command lines.
Here is the result of my research and what I am doing:
Code: Select all
root@puppypc28983 ~
# dd if=/dev/zero of=$HOME/virtual_disk/DISK.img bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 1,31024 s, 410 MB/s
root@puppypc28983 ~
# losetup /dev/loop3 $HOME/virtual_disk/DISK.img
losetup: /dev/loop3
root@puppypc28983 ~
# fdisk /dev/loop3
Welcome to fdisk (util-linux 2.21.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): o
Building a new DOS disklabel with disk identifier 0x1ad8c107.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-1048575, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1048575, default 1048575):
Using default value 1048575
Partition 1 of type Linux and of size 511 MiB is set
Command (m for help): a
Partition number (1-4): 1
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
root@puppypc28983 ~
#
Thanks.
Cordialement.