File system

Programming, for all ages and all languages.
Post Reply
grenders22
Posts: 16
Joined: Thu Mar 01, 2018 10:09 am

File system

Post 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.
StudlyCaps
Member
Member
Posts: 232
Joined: Mon Jul 25, 2016 6:54 pm
Location: Adelaide, Australia

Re: File system

Post 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.
Last edited by StudlyCaps on Mon Jun 25, 2018 9:28 am, edited 1 time in total.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: File system

Post 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.)
Every good solution is obvious once you've found it.
Post Reply