I want to make a virtual harddisk because I am trying to build a linux system from source. Following this tutorial, I have successfully created a virtual harddisk image. I made 20 GB of it, did mkfs ext4, and partitioned it into 3 partition using fdisk:

  1. 10GB for root partition
  2. 1GB for swap partition
  3. 1MB for boot partition

I can mount the whole img but I don't see any partition nor can I access them. I want to be able to mount them in /mnt/test, /mnt/test/swap, and /mnt/test/boot in my main system. I have tried using offset option while doing mount and made the image a gpt table (the default is dos when I enter fdisk) but the image won't be mounted at all (error: wrong fs type, bad option, etc). What should be done?

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.