Page 1 of 1

File system

Posted: Fri Jun 22, 2018 5:59 am
by grenders22
I run the file system into ketu. Everything is working.

Code: Select all

qemu-system-i386 -kernel kernel -hda hda.img

Code: Select all

fs_init("/dev/hda"); // /dev/hda device name
Then I divided the flash drive into two partitions. At first I installed a grub2. The second one for files (ext2). But no device name can be seen. In ubuntu the second section as /dev/sdb2.
I do not know what to do, help please.

Re: File system

Posted: Sat Jun 23, 2018 2:53 am
by StudlyCaps
You maybe need to give more info, but if your drive is not appearing in Ubuntu but you have a /dev/* entry for it, make sure it's getting mounted (entry in /etc/fstab for example). Linux expects all drives to be explicitly mounted.

Edit: Nevermind, I misread the question.

Re: File system

Posted: Mon Jun 25, 2018 8:44 am
by Solar
If there is no file corresponding to the partition in /dev, you cannot mount it, because "mount" binds a device to a mount point. No device, no mounting.

I am not familiar with QEMU, but I notice that you are handling /dev/hda -- i.e., the whole hard drive. Partitions are numbered -- /dev/hda1, /dev/hda2. Now, it could be totally normal to call fs_init() on /dev/hda, or it could be that you are using the whole hard drive image as a partition, and that you don't have code in place for handling a device (which could hold multiple partitions) at all? (That is actually a rather common issue when using virtual computers -- using the whole disk like one partition. On real hardware, that simply wouldn't work.)