Virtual disk to create and partition

I have to do this exercise:

  • Create a virtual disk
  • Partition this disk
  • Create File system
  • Mount File System

I'm using Minix (which runs by Qemu as guest machine) on Linux (Host)

Is there anybody who knows how to solve first three point? :confused:
Thanks

I guess you want to do that to get some more space for Minix (the Qemu guest machine)?
Do you have the Qemu Launcher installed? If so, then it's gonna be a pretty easy task.
I've successfully tested following steps with DSL as Qemu guest on FreeBSD host:

  1. Creating the actual virtual disk on host:
    Open a shell and go to a directory, where you want to create the virtual disk and type following command (In my case I wanted the virtual disk to be 1 GB "large")
qemu-img create virtdisc.img 1G
  1. Open the Qemu Launcher, click on the button "Open" next to "Hard disk 1" entry, browse to the directory which is containing the image you have previously created, select the image and click the "Open" button.

  2. Launch your Guest OS.

  3. Now you need to check if the new created disk is recognized by your Guest OS. Run

dmesg | grep hd

to know that. If you're lucky, you will find a couple lines similar to these:

<4>hdb: attached ide-disk driver
<6>hdb: 2097152 sectors (1074 MB) w/256KiB Cache, CHS=130/255/63
<6>Partition check:
<6> hdb: unknown partition table
  1. Right now you need to create a partition:
cfdisk -z /dev/hdb

The usage of this tool is pretty self-explanatory.

  1. Reboot Guest OS

  2. Check if the partition was successfully created, use "dmesg | grep hd" again. This time the hdb line will look slightly different:

<6> hdb: hdb1

Looks good ^^

  1. It's time to format the partition:
mkfs /dev/hdb1
  1. Mount your new virtual disk:
mount /dev/hdb1 /mnt/hdb1
  1. Enjoy
df -h
1 Like

dmesg doesn't exist in my version of minix (R3.1.6) :frowning:

---------- Post updated at 06:30 AM ---------- Previous update was at 05:18 AM ----------

This is the settings of Qemu launcher. Is it right?

Minix hasn't the command dmesg, How can I find virtual image in /dev/ ? :confused:

Try

cat /var/log/dmesg

.

:b:

1 Like

/var/log/ is empty, but now I know

You can find Virtual disk in this order (in Minix, in this case, but similar for other):

Hard Disk 0: /dev/c0d0
Hard Disk 1: /dev/c0d1
Hard Disk 2: /dev/c0d2
.............. : ......

Pseudocoder thank you for your help :b::b: :D:D