LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-25-2007, 11:33 AM   #1
silencestone
Member
 
Registered: Mar 2006
Location: USA
Distribution: [Current: Ubuntu, openSUSE, Arch] | {Past: Vector, Deli, Mint, Wolvix, OpenSUSE, Slackware, Puppy}
Posts: 71

Rep: Reputation: 15
Question 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?
 
Old 03-25-2007, 11:58 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
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?
 
1 members found this post helpful.
Old 03-25-2007, 12:23 PM   #3
erklaerbaer
Member
 
Registered: Mar 2006
Posts: 381

Rep: Reputation: 30
could you provide the output of dmesg and lsmod?
 
Old 03-26-2007, 03:37 PM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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

Last edited by urka58; 03-26-2007 at 03:41 PM.
 
1 members found this post helpful.
Old 03-26-2007, 07:00 PM   #5
silencestone
Member
 
Registered: Mar 2006
Location: USA
Distribution: [Current: Ubuntu, openSUSE, Arch] | {Past: Vector, Deli, Mint, Wolvix, OpenSUSE, Slackware, Puppy}
Posts: 71

Original Poster
Rep: Reputation: 15
Smile 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. 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.
 
Old 03-26-2007, 10:37 PM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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
 
Old 03-27-2007, 02:54 PM   #7
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
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
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
 
Old 03-27-2007, 03:00 PM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

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

Thanks for the reply.
 
Old 03-27-2007, 05:42 PM   #9
silencestone
Member
 
Registered: Mar 2006
Location: USA
Distribution: [Current: Ubuntu, openSUSE, Arch] | {Past: Vector, Deli, Mint, Wolvix, OpenSUSE, Slackware, Puppy}
Posts: 71

Original Poster
Rep: Reputation: 15
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!
 
Old 03-29-2007, 11:55 PM   #10
billairds
LQ Newbie
 
Registered: Feb 2007
Posts: 24

Rep: Reputation: 16
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
 
  


Reply

Tags
compact, flash, mknod, mount, pcmcia


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat finite Linux - Hardware 8 03-10-2009 12:52 AM
How do I create a file in /dev/usb? Lakota Mandriva 3 10-24-2004 07:32 AM
One of my local file systems /dev/sda9 is not mounting Fairlie Linux - Newbie 8 05-10-2004 11:27 PM
Mounting USB Devices--Controlling the dev file lawrencegoodman Linux - Hardware 1 03-08-2004 04:57 PM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration