Demo
Now we can try the whole demo example with the following commands:
Create a new file
test.diskto hold the virtual drive volume by pre-filling the file with data:~$ dd if=/dev/zero of=test.disk bs=64M count=1Next up we give the volume a filesystem. Here, we format it with FAT32:
~$ mkfs.vfat -F 32 -f 2 -S 512 -s 1 -R 32 test.diskCheck the details of the FAT filesystem:
~$ dosfsck -v test.diskMount: to mount the formatted file
test.diskfrom the terminal, you will need to first create a folder to mount it to. Let’s say we want to mount it to the folder~/rd.
** Here is the procedure:
First create the folder there.
~$ mkdir ~/rdThen mount the file
test.diskto the folder~/rd:~$ sudo mount -t vfat -o loop test.disk ~/rdNow we can create/copy files to the drive:
~$ cd ~/rd ~/rd$ ls ~/rd$ sudo touch a ~/rd$ lsWhen we finished,
unmountthe volume by running this command:~/rd$ cd - $ sudo umount ~/rd
Here are the results of the demo:

Last updated
Was this helpful?