VectorLinux

The nuts and bolts => Technical General => Topic started by: Pita on May 05, 2007, 10:49:34 pm

Title: No /dev/sd?? files
Post by: Pita on May 05, 2007, 10:49:34 pm
I just found that there are no /dev/sd?? files in my VL-5.8-Gold box.

ls /dev/sd*
ls: /dev/sd*: No such file or directory

How would I get them?

Regards
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 05, 2007, 10:52:42 pm
Well, as per udev, those files are only generated providing you need them somehow. For example, plugging in a flash drive might generate /dev/sda, /dev/sda1, etc. Not to mention what happens when one uses ACTUAL SCSI hard drives.

The essential question then, I guess, is "do you have any real or virtual SCSI disks (such as flash drives) attached?"
Title: Re: No /dev/sd?? files
Post by: Pita on May 05, 2007, 11:28:26 pm
Thanks! No I have no real or virtual SCSI disk.

I installed the new Zenwalk and it is mounted on sd* files. So when I tried to put it into lilo, lilo could not find those files.

I went into my old slack box and there they were. I configured lilo then and was able to boot into zenwalk. Well, for what I saw I don't need to boot it a second time. Still why are those files in slackware and not in VL.

Regards
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 05, 2007, 11:41:13 pm
Thanks! No I have no real or virtual SCSI disk.

I installed the new Zenwalk and it is mounted on sd* files.

How is that possible? In any case, if you know the major and minor device numbers of the device(s) in question, you can use the mknod command to create the device manually. The list is here

http://www.kernel.org/pub/linux/docs/device-list/devices.txt

So, for example, mknod /dev/sda1 b 8 1 generates the appropriate block device at /dev/sda1.

(Also, I wonder if one can generate fake events for udev...)
Title: Re: No /dev/sd?? files
Post by: Pita on May 05, 2007, 11:54:24 pm
Thanks again!

Created /dev/sdb6 where I have zenwalk installed. Just for the heck of it will boot into it with VL lilo once more.

ls /dev/sd*
/dev/sdb6

Yes strange zenwalk-4.6 insists to name the devices to install in sd*. It took me 3 starts to finally agree since I thought I had made a mistake.
Title: Re: No /dev/sd?? files
Post by: Pita on May 06, 2007, 12:23:08 am
Thanks again!

Created /dev/sdb6 where I have zenwalk installed. Just for the heck of it will boot into it with VL lilo once more.

ls /dev/sd*
/dev/sdb6

Yes strange zenwalk-4.6 insists to name the devices to install in sd*. It took me 3 starts to finally agree since I thought I had made a mistake.

/dev/sdb6 did not survive a reboot.
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 06, 2007, 12:37:50 am
(http://ewancient.lysator.liu.se/art/b/e/behe/photo_1.jpg.index.jpeg)

The magick invocation goes into /etc/rc.d/rc.local then...
Title: Re: No /dev/sd?? files
Post by: Pita on May 07, 2007, 12:37:04 am
Just to inform /dev/sdb6 does not mount, it shoots back:

/dev/sdb6 is not a valid block device

That's OK, I will not pusue this thread any further.

Regards
Title: Re: No /dev/sd?? files
Post by: Joe1962 on May 07, 2007, 01:16:16 am
I assume you have a SATA hard drive. A recent kernel version (can't remember right now) introduced a change in SATA device naming conventions, from /dev/hdx to /dev/sdx (as is used in SCSI HDDs). If this is your case, then when you boot into an older kernel, /dev/sda6 would be /dev/hda6.

BTW, if you want to force udev to create a device on boot, you need to put it in /lib/udev/devices.
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 07, 2007, 06:19:06 am
I assume you have a SATA hard drive. A recent kernel version (can't remember right now) introduced a change in SATA device naming conventions, from /dev/hdx to /dev/sdx (as is used in SCSI HDDs). If this is your case, then when you boot into an older kernel, /dev/sda6 would be /dev/hda6.

BTW, if you want to force udev to create a device on boot, you need to put it in /lib/udev/devices.

Oh, goody, didn't know about that one.
Title: Re: No /dev/sd?? files
Post by: Pita on May 07, 2007, 08:49:41 pm
Changed my mind and will continues thread.

I just upgraded to kernel 2.6.20.3 from 2.6.18 both in VL-5.8-Gold and SlackWare-11.

In SW I find a whole lot of /dev/sd* even with older kernel whereas none at all in VL. In SW /lib/udev/devices there is no mention of sd*.
Putting sdb6 into  /lib/udev/devices I still can't mount it after reboot, get samre error as mentioned above, "not a valid block device". Same when I copy device from SW to VL.

So how do all those sd* devices in slackware get into /dev there?
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 07, 2007, 09:09:06 pm
Does that version Slackware use udev?

Furthermore, how did you copy the device? I think you would have to use tar to get it to work properly.

What is the output of ls -l /dev/sd* on Slackware and Vector, respectively?
Title: Re: No /dev/sd?? files
Post by: Pita on May 07, 2007, 11:17:57 pm
Does that version Slackware use udev?

Yes

Furthermore, how did you copy the device? I think you would have to use tar to get it to work properly.

in slackware cp to /mnt/vl/dev

What is the output of ls -l /dev/sd* on Slackware and Vector, respectively?

slackware
ls -l /mnt/swroot/dev/sd*
from /dev/sda
...snip....
brw-r----- 1 root disk 8,  16 1995-04-29 18:34 /mnt/swroot/dev/sdb
brw-r----- 1 root disk 8,  17 1995-04-29 18:34 /mnt/swroot/dev/sdb1
brw-r----- 1 root disk 8,  26 1995-04-29 18:34 /mnt/swroot/dev/sls -l
brw-r----- 1 root disk 8,  27 1995-04-29 18:34 /mnt/swroot/dev/sdb11
brw-r----- 1 root disk 8,  28 1995-04-29 18:34 /mnt/swroot/dev/sdb12
brw-r----- 1 root disk 8,  29 1995-04-29 18:34 /mnt/swroot/dev/sdb13
brw-r----- 1 root disk 8,  30 1995-04-29 18:34 /mnt/swroot/dev/sdb14
brw-r----- 1 root disk 8,  31 1995-04-29 18:34 /mnt/swroot/dev/sdb15
brw-r----- 1 root disk 8,  18 1995-04-29 18:34 /mnt/swroot/dev/sdb2
brw-r----- 1 root disk 8,  19 1995-04-29 18:34 /mnt/swroot/dev/sdb3
brw-r----- 1 root disk 8,  20 1995-04-29 18:34 /mnt/swroot/dev/sdb4
brw-r----- 1 root disk 8,  21 1995-04-29 18:34 /mnt/swroot/dev/sdb5
brw-r----- 1 root disk 8,  22 1995-04-29 18:34 /mnt/swroot/dev/sdb6
...snip...
all the way to /dev/sdh9

VL
ls -l /dev/sd*
/bin/ls: /dev/sd*: No such file or directory

mknod /dev/sdb6 b 8 22

ls -l /dev/sd*
brw-r--r-- 1 root root 8, 22 2007-05-08 14:23 /dev/sdb6

 mount /dev/sdb6
mount: /dev/sdb6 is not a valid block device



Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 07, 2007, 11:44:51 pm
Is that a SATA hard drive you're using?
Title: Re: No /dev/sd?? files
Post by: Pita on May 08, 2007, 12:18:23 am
Is that a SATA hard drive you're using?

I can't answer that with a full yes, however, I guess so yes.

In slack I use the bare.i kernel, VL just installs w/o asking and now in zenwalk it looks that it is a sata drive, that what it said and installed on and I can boot into from salckware.

From zenwalk message.txt
The Zenwalk kernel is configured with exclusive LIBATA subsystem, all SATA and PATA devices are called "sdX" (Optical devices are called "srX").

Title: Re: No /dev/sd?? files
Post by: Pita on May 11, 2007, 12:29:29 am
Was able to get /dev/sdb6 into lilo to boot into that partiion under VL.

/dev/sdb6 has to be in /dev. In fstab /dev/hdd6 remains and can thus be mounted. In lilo.conf setting is root=/dev/sdb6.

Just thought this might be useful for others having such an initial problem with that new device naming.
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 11, 2007, 12:34:29 am
Well that's certainly idiosyncratic. How'd you track down the answer?
Title: Re: No /dev/sd?? files
Post by: Pita on May 11, 2007, 02:51:57 am
Well that's certainly idiosyncratic. How'd you track down the answer?

Meaning what ????
Title: Re: No /dev/sd?? files
Post by: Triarius Fidelis on May 11, 2007, 12:40:05 pm
In LILO, you have to use /dev/sdb6.

But to mount the drive, you have to use /dev/hdb6.

That's strange.
Title: Re: No /dev/sd?? files
Post by: Pita on May 11, 2007, 07:11:02 pm
In LILO, you have to use /dev/sdb6.

But to mount the drive, you have to use /dev/hdb6.

That's strange.

Strange, yes. Who can ever fathom Linux?

To run lilo the different partions one wants to boot into have to be mounted. I can't mount /dev/sdb6. It spits back: /dev/sdb6 is not a valid block device.

If in lilo.conf I will put root = /dev/hdd6 as it is in fstab instead of /dev/sdb6 I end with kernel panic when trying to boot into that prticular partition.

Beats me too. However, it works the way I have it set now.
Title: Re: No /dev/sd?? files
Post by: Kocil on July 14, 2007, 12:10:51 am
In LILO, you have to use /dev/sdb6.

But to mount the drive, you have to use /dev/hdb6.

That's strange.

I got the same strange thing in my notebook with SATA harddisk, and IDE layer in BIOS.
Kernel 2.4.x and kernel older than 2.6.18 report it as /dev/hda,
but kernel 2.6.19 - 2.6.21 report it as /dev/sda.
So you will have problem if you have 2 OS with those conflicting kernels.

Since I upgraded the kernel to 2.6.22, the harddisk is known as /dev/hda, consistently.