LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How create file in /dev for mounting harddrive? (https://www.linuxquestions.org/questions/slackware-14/how-create-file-in-dev-for-mounting-harddrive-540471/)

silencestone 03-25-2007 11:33 AM

How create file in /dev for mounting harddrive?
 
I'm trying to mount a compact flash card in a pcmcia slot on a laptop. I've used this card on Linux on other computers before, so I know it works--always mounts normally as an IDE hard drive with a single vfat partition. This time, unfortunately, though the card is recognized on insertion and drivers are loaded, no corresponding file exists in /dev for the CF drive to be mounted as a hard drive.

Reading dmesg, the CF card is recognized as hdc, with a partition, hdc1. /dev has a long list of entries, including excessive hard drive partitions such as "hda2" and "hdd1". "hdc" is included, but no "hdc1", and attempting to mount CF on hdc elicited errors. Can I just create an "hdc1" in /dev? Checking the properties of other existing, valid hard drive files in /dev identify them "brwxrwxrwx", and that "b" is supposed to mean 'block device file', right? So how do you create a block device file?

GrapefruiTgirl 03-25-2007 11:58 AM

To manually create a character or block device, check out the command 'mknod' by reading the man page (man mknod).
Incidentally, is there an entry in the /etc/fstab file for this drive?

erklaerbaer 03-25-2007 12:23 PM

could you provide the output of dmesg and lsmod?

urka58 03-26-2007 03:37 PM

As already said you can create a device node manually by "mknod".
In order you can assign a correct minor number to such device have a look at
ls -l /dev/hd? /a/b/b1 output.
Mine for conventional ide disks on first ide channel is
brw-rw---- 1 root disk 3, 0 2002-06-09 21:27 hda ---> master
brw-rw---- 1 root disk 3, 64 2007-03-26 18:43 hdb ---> slave
brw-rw---- 1 root disk 3, 65 2007-03-26 18:43 hdb1 ---> first partition

so... according to lanana http://www.lanana.org/docs/device-list/devices-2.6+.txt

you should have on your second ide channel (master) something like
brw-rw---- 1 root cdrom 22, 0 2007-03-26 18:43 hdc
major nr (22)
minor nr (0)
so..
mknod /dev/hdc1 b 22 1

should do the trick unless there's something wrong with the VFAT_FS driver as the partition is not properly reccognised.
Ciao

silencestone 03-26-2007 07:00 PM

Working, now!
 
Thank you all for your help!

The mknod command did the trick, though I changed the group from "root" to "disk" to match the file for the other mounted hard drive, just in case. That link to device allocations had a lot of information: It was everything I needed for understanding. First, you have to know whether the device is a block or character, defined by how it transfers data--one character at a time, or in blocks. Then, the first number is the major which is used to categorize devices by function/interface. The second number is the minor which indicates the order of all the devices in that category, or provides further functional categorization. :scratch: Yeah? Anyway, mknod hdc1 b 22 1 in the /dev directory worked. After that, the CompactFlash disk (identified as hdc1 according to dmesg) mounted faultlessly with mount -t vfat /dev/hdc1 /mnt/cf

Again, thank you all for your helpful, prompt responses.

H_TeXMeX_H 03-26-2007 10:37 PM

What a strange issue ... never seen anything like it, where you actually have to use 'mknod'. Technically, shouldn't it work automatically (shouldn't nodes be created automatically) ? What kind of issue might prevent this from happening automatically ? I don't quite understand :scratch:

urka58 03-27-2007 02:54 PM

Quote:

Originally Posted by H_TeXMeX_H
What a strange issue ... never seen anything like it, where you actually have to use 'mknod'. Technically, shouldn't it work automatically (shouldn't nodes be created automatically) ? What kind of issue might prevent this from happening automatically ? I don't quite understand :scratch:

A flash card on an ide channel, that's strange..?! That's the reason I always stay away from such "trick & track little machines".
Anyway, it is possible there something wrong with the specific device driver
Ciao

H_TeXMeX_H 03-27-2007 03:00 PM

Hmmm ... maybe it's because it is on an IDE channel. It's quite rare from what I can tell.

Thanks for the reply.

silencestone 03-27-2007 05:42 PM

I'm just glad it worked. I'd never had such a problem before, which is why I was so clueless, but it's probably because the distro designer sacrificed some automagic conveniences to fit a workable system into less space and be suitable for older computers. Really, I can't criticize, since the tools to get it working were there. My fault that I didn't know what was there and how to use it. Forums are great things!

billairds 03-29-2007 11:55 PM

mine is mounted as a scsi device /dev/sdb1 and if memory serves me correctly it has to be set up that way. you will also need to set fstab aand create a dir. to mount the device



billairds


All times are GMT -5. The time now is 06:56 AM.