Mounting a loopback hard disk
Posted: Wed Aug 20, 2008 10:34 am
Hey all!.. I am currently working on the file system and volume architecture of my os. So in order to test my interface, i need to make a hard disk image which is around 100MB or so which i can use with Bochs. I want partitions and a filesystem in this image.
So i used the losetup to create /dev/loop0 and then created a partition table on it using fdisk. But how do i create a filesystem on the partitions? The partitions do not appear as /dev/hdc1 /dev/hdc2 etc as for a normal hard disk. Besides who exactly creates those /dev/hdc1,/dev/hdc2.... from /dev/hdc when linux creates devices...?
I could run a linux image in Bochs and make it operate directly on the hard disk image. But this seems like a problem i feel i should solve.
So i used the losetup to create /dev/loop0 and then created a partition table on it using fdisk. But how do i create a filesystem on the partitions? The partitions do not appear as /dev/hdc1 /dev/hdc2 etc as for a normal hard disk. Besides who exactly creates those /dev/hdc1,/dev/hdc2.... from /dev/hdc when linux creates devices...?
I could run a linux image in Bochs and make it operate directly on the hard disk image. But this seems like a problem i feel i should solve.