Block device, handled by 'memory' driver, device #13 (i.e. 1 more than
the "usual" number).
You can probably make it easier to debug by using any number between 7
and 12 instead, i.e. sticking to the already defined any-use ramdisks.
This would mean not having to modify anything in memory.
Minor 4 (BOOT_DEV, i.e. /dev/boot) can also be considered if you want to
avoid fiddling with the user ramdisks.
> mount /dev/mydisk /mnt
>
> I get the following error message from mount:
> mount: Can't mount /dev/mydisk on /mnt: Invalid argument
Well, the only occurrence of EINVAL (the same as "Invalid argument") in
drivers/memory/memory.c is
switch (m_device) {
/*...*/
default:
/*...*/
/* Bogus number. */
if(m_device < 0 || m_device >= NR_DEVS) {
return(EINVAL);
}
So either the 'memory' driver which is answering to mount/VFS is not the
one you modified (and in the in-use memory driver, ramdisk#7 i.e. minor
13 will indeed appears as EINVAL); or EINVAL is returned by the code in
mfs/mount.c or mfs/super.c`read_super(); as you can see, there are quite
a number of reasons for this code...
Another options is to try fsck against the ramdisk image, then against
the device.
Antoine
On 10/16/2011 03:13 PM, orangemako wrote:
> Hi everyone,
>
> Here's some details of what I've done so far:
>
> When I try to mount my ram disk through the command line after
> having created the ram disk device file through mknod:
> mknod /dev/mydisk b 1 13
> mount /dev/mydisk /mnt
>
> I get the following error message from mount:
> mount: Can't mount /dev/mydisk on /mnt: Invalid argument
>
It seems to me you've missed the part where you format the ram disk.
That's causing req_readsuper to fail; there is no super block. So the
steps are:
ramdisk <size in kB> /dev/ram?
mkfs.mfs /dev/ram?
mount /dev/ram? /mnt
It's not entirely clear to me why you'd want to create an additional ram
disk minor. There are already several available to you (and, in general,
unused): /dev/ram0 up to /dev/ram5. Please note that, as I said in the
thread linked to by pikpik, the memory driver has a hard coded limit of
6 ram disks. You first need to recompile the memory driver with a higher
constant if you need more than that.
--
Thomas