Click to See Complete Forum and Search --> : Problem mounting drive (filesystem)!


pushback
12-01-2002, 07:33 PM
Hello!

I have a 60GB Maxtor drive I am trying to mount as hdc. The file system is in good shape as I have mounted it succesfully as hdb.

So, here's what I get when I try to mount it:

piggy[root]:/-> mount -t ext3 /dev/hdc u0
mount: /dev/hdc is not a valid block device

Do I have to add kernel support for hdc or something? There is a driver in the /dev directory:

piggy[root]:/dev-> ls -l hdc
brw-rw---- 1 root disk 22, 0 Aug 30 16:31 hdc

This is running on redhat8.0

I do have another box running redhat 7.2 and it is running fine with and hda, hdb, hdc and hdd!

Thanks for the help.

John
jek@pobox.com

... and yes--if you like my prompt you can have it. Just put this in your /etc/profile:

PS1=`uname -n`'['`exec /usr/bin/whoami`']:$PWD-> '
export PS1

slapNUT
12-01-2002, 08:17 PM
Try this to see if the kernel is recognising the device.
dmesg|grep hdc

pushback
12-01-2002, 10:05 PM
Thanks for that.

Apparently not compiled in! Though the hardware is present. How do I get this driver to compile into the kernel? It was attached when I installed so I assumed it would get compiled in... oh well. In any case do you know what module I have to compile in?


piggy[root]:/root-> dmesg|grep hd
Kernel command line: ro root=LABEL=/ hdc=ide-scsi
ide_setup: hdc=ide-scsi
ide0: BM-DMA at 0x10a0-0x10a7, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0x10a8-0x10af, BIOS settings: hdc:DMA, hdd:DMA
hda: Maxtor 96147H8, ATA DISK drive
hdb: IC35L120AVVA07-0, ATA DISK drive
hdc: Maxtor 96147H8, ATA DISK drive
hdd: CD-ROM CDU4011, ATAPI CD/DVD-ROM drive
hda: 120060864 sectors (61471 MB) w/2048KiB Cache, CHS=7473/255/63, UDMA(33)
hdb: 241254720 sectors (123522 MB) w/1863KiB Cache, CHS=15017/255/63, UDMA(33)
hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 hda9 hda10 hda11 >
hdb: hdb1 hdb2
hdd: ATAPI 40X CD-ROM drive, 120kB Cache
hdc: driver not present
hdc: driver not present
hdc: driver not present
hdc: driver not present
hdc: driver not present

pushback
12-02-2002, 05:30 AM
I need to recompile my kernel to allow me to mount /dev/hdc & /dev/hdd on Red Hat 8.0. How do I include this module?

Thanks!

mdwatts
12-02-2002, 07:01 AM
Are you referring to scsi emulation for the hdc and hdd (?? cdwriter ??)?

Redhat should already include the required scsi emulation modules by default.

If that is not the case, could you please explain.

pushback
12-02-2002, 07:24 AM
Nope. I just want to mount a hard drive on hdc and I get

piggy[root]:/-> mount -t ext3 /dev/hdc /u0
mount: /dev/hdc is not a valid block device


Thanks (in advance) for your help!

John

michaelk
12-02-2002, 10:02 AM
You need to specify a partition number in the mount command.

mount -t ext3 /dev/hdc1 /u0

The command:
fdisk -l /dev/hdc

will display partition information.

No need to recompile kernel.

slapNUT
12-02-2002, 01:24 PM
Well you've got 2 other IDE/ATA Disk drives and they are working, so that one should work also.

Look in lilo.conf and see if you have an append "hdc=ide-scsi". If you do remove that as it is for a cdwriter.

Other things I would suggest checking are the jumpers on the drive. Check /etc/fstab and make sure its correct. You could swap it with the CD/DVD and see if the drive works as hdd.

pushback
12-02-2002, 02:16 PM
Thanks fot the reply.... On my 7.2 machine I do this all the time when using the entire disk for one file system:

athena[root]:/root-> mount -t ext2 /dev/hdc /u1
athena[root]:/root->

In any case, trying it with hdc1 on the 8.0 machines gives the same error:

piggy[root]:/root-> mount -t ext3 /dec/hdc1 /u0
mount: special device /dec/hdc1 does not exist


Here's fdisk: (on 7.2)

athena[root]:/root-> fdisk -l /dev/hdc

Disk /dev/hdc: 16 heads, 63 sectors, 155061 cylinders
Units = cylinders of 1008 * 512 bytes

Disk /dev/hdc doesn't contain a valid partition table

and on 8.0:

piggy[root]:/root-> fdisk -l /dev/hdc
piggy[root]:/root->


(nothing)

Any ideas?

John

fancypiper
12-02-2002, 02:17 PM
Have you tried mounting /dev/hdc1 rather than /dev/hdc?

michaelk
12-02-2002, 04:40 PM
I know what you are saying. I have some equipment that writes data to a HD that isn't formated in at all.

Is there any data on the HD on the 8.0 system?

mdwatts
12-02-2002, 05:28 PM
Originally posted by pushback

Here's fdisk: (on 7.2)

athena[root]:/root-> fdisk -l /dev/hdc

Disk /dev/hdc: 16 heads, 63 sectors, 155061 cylinders
Units = cylinders of 1008 * 512 bytes

Disk /dev/hdc doesn't contain a valid partition table

and on 8.0:

piggy[root]:/root-> fdisk -l /dev/hdc
piggy[root]:/root->


(nothing)

Any ideas?

John

Are you quite sure hdc and hdd are HD's and contain a valid formatted filesystem?

If you can mount your normal partitions on hda, then there shouldn't be anything stopping you from mounting 'valid' partitions on hdc or hdd.

You already have all the kernel support you need.

pushback
12-02-2002, 05:45 PM
Yep. And I agree. I should be able to mount it but I cannot.

In any case, I should be able to fdisk it, right?

piggy[root]:/root-> fdisk /dev/hdc

Unable to open /dev/hdc
piggy[root]:/root-> fdisk /dev/hdc1

Unable to open /dev/hdc1
piggy[root]:/root->


---

Now, I know the hardware is good because I have had it mounted as hdb (since trying it as hdc). This happens with other disks as well.

For the record, hdd is the cdrom and it works perfectly:

piggy[root]:/root-> mount -t iso9660 /dev/hdd /u0
mount: block device /dev/hdd is write-protected, mounting read-only

pushback
12-02-2002, 08:11 PM
I already had a thread on this and it vanished! So, I will start again.

I am trying to mount a drive as hdc. It does not seem to be supported for some reason. The drive is good as I have mounted it on other boxes as well as on the same box as hdb.

Here's what I get when I try to mount it:

piggy[root]:/root-> mount -t ext2 /dev/hdc /u0
mount: /dev/hdc is not a valid block device
piggy[root]:/root-> mount -t ext2 /dev/hdc1 /u0
mount: /dev/hdc1 is not a valid block device
piggy[root]:/root-> fdisk /dev/hdc

Unable to open /dev/hdc
piggy[root]:/root-> mount -t iso9660 /dev/hdd /u0
mount: block device /dev/hdd is write-protected, mounting read-only
piggy[root]:/root->

As you can see, I can mount /dev/hdd just fine (the cdrom), so the second controller is working and the BIOS supports it.

So, I think maybe I need to compile support for hdc into the kernel. My question is which module do I need to compile in? Also, if you have another view I would love to hear/see it!

Any help will be appreciated... and please do not delete my thread!

John

Ddruid
12-02-2002, 08:30 PM
Are you sure that /dev/hdc exists?

Ddruid
12-02-2002, 08:33 PM
I should add that if it doesn't exist, then you can create it using /dev/MAKEDEV, see man MAKEDEV for details.

pushback
12-02-2002, 08:37 PM
Here it is!

piggy[root]:/root-> ls -l /dev/hdc
brw-rw---- 1 root disk 22, 0 Aug 30 16:31 /dev/hdc
piggy[root]:/root->

as far as the physical drive is concerned, yes, I am absolutely sure it is hooked up. I have tried three or four drives and they do appear in the BIOS message when the machine boots as well as in the boot log (dmesg) below:

PIIX4: IDE controller on PCI bus 00 dev 39
PIIX4: chipset revision 1
PIIX4: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0x10a0-0x10a7, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0x10a8-0x10af, BIOS settings: hdc:DMA, hdd:DMA
hda: Maxtor 96147H8, ATA DISK drive
hdb: IC35L120AVVA07-0, ATA DISK drive
hdc: WDC AC2420F, ATA DISK drive.......................<---<b>there it is!</b>
hdd: CD-ROM CDU4011, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
blk: queue c03c0004, I/O limit 4095Mb (mask 0xffffffff)
blk: queue c03c0004, I/O limit 4095Mb (mask 0xffffffff)
hda: 120060864 sectors (61471 MB) w/2048KiB Cache, CHS=7473/255/63, UDMA(33)
blk: queue c03c0140, I/O limit 4095Mb (mask 0xffffffff)
blk: queue c03c0140, I/O limit 4095Mb (mask 0xffffffff)
hdb: 241254720 sectors (123522 MB) w/1863KiB Cache, CHS=15017/255/63, UDMA(33)
ide-floppy driver 0.99.newide
Partition check:
hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 hda9 hda10 hda11 >
hdb: hdb1 hdb2
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077


bizarre... huh?

fancypiper
12-02-2002, 08:40 PM
Does the drive contain a valid filesystem?

If it doesn't, you have to create the filesystem.
Use Windows format utility to make a fat32 (or other Windows) fs.

Possible commands to make Linux filesystems:
mke2fs /dev/hdc1 (ext2)
mke2fs -j /dev/hdc1 (ext3)
mkreiserfs /dev/hdc1 (ReiserFS)
mkfs.xfs /dev/hdc1 (xfs)
mkswap /dev/hdc1 (swap)

Then create a mount point:
mkdir /mnt/hdc

Now, you can mount the filesystem:
mount /dev/hdc1 /mnt/hdc

Odin
12-02-2002, 09:14 PM
Is your HDD connected properly inside the box? It doesn't seem to be seeing it at all.

Ddruid
12-02-2002, 10:53 PM
Another stupid suggestion...
What fstype is the drive formatted with? also do you have that driver compiled into the kernel or as a module? In your examples you are tossing around ext2 and ext3 too freely...
athena[root]:/root-> mount -t ext2 /dev/hdc /u1
athena[root]:/root->
In any case, trying it with hdc1 on the 8.0 machines gives the same error:
piggy[root]:/root-> mount -t ext3 /dec/hdc1 /u0
mount: special device /dec/hdc1 does not exist


If I were to take a stab at it, I would guess the fs on the drive is ext2, try mounting it as ext2 if you haven't already, also check to see if you have the ext2 driver either in the kernel or as a module..

pushback
12-03-2002, 05:09 AM
Aint happenin. The FS is good. I have mounted it as hdb and can read it fine.

piggy[root]:/root-> mke2fs /dev/hdc1
mke2fs 1.27 (8-Mar-2002)
mke2fs: No such device or address while trying to determine filesystem size
piggy[root]:/root-> mke2fs -j /dev/hdc1
mke2fs 1.27 (8-Mar-2002)
mke2fs: No such device or address while trying to determine filesystem size
piggy[root]:/root->


Open for more ideas!

Hena
12-03-2002, 06:10 AM
Check what fdisk gives out "fdisk -l".

Other thing to check is the /proc files. I'm using scsi disks and have file "/proc/scsi/scsi" which have information about the scsi devices attached to my box. I would assume that something similar is for ide as well. View them with commands like "cat" or "less".

Third option is to make sure bios detects it. If you used it as hdb, then it should, but did the third disk then show?.

mdwatts
12-03-2002, 07:30 AM
Originally posted by pushback
I already had a thread on this and it vanished! So, I will start again.

and please do not delete my thread!

John

I didn't delete your second thread, but only merged into the first one of which I have now done the same for the third.

All all together in this thread...

As of 6:30 this morning, the missing thread was 17 threads down from this one.

pushback
12-03-2002, 07:38 AM
Yeah, this is a tricky one allright.

Yes, the BIOS does detect it, in fact it shows even shows in dmesg:

hda: Maxtor 96147H8, ATA DISK drive
hdb: IC35L120AVVA07-0, ATA DISK drive
hdc: WDC AC2420F, ATA DISK drive
hdd: CD-ROM CDU4011, ATAPI CD/DVD-ROM drive

---
fdisk gives no info back either:

piggy[root]:/root-> fdisk -l /dev/hdc
piggy[root]:/root->

or fsck for that matter:

piggy[root]:/root-> fsck /dev/hdc
fsck 1.27 (8-Mar-2002)
e2fsck 1.27 (8-Mar-2002)
fsck.ext2: No such device or address while trying to open /dev/hdc
Possibly non-existent or swap device?
piggy[root]:/root-> fsck /dev/hdc1
fsck 1.27 (8-Mar-2002)
e2fsck 1.27 (8-Mar-2002)
fsck.ext2: No such device or address while trying to open /dev/hdc1
Possibly non-existent or swap device?
piggy[root]:/root->

Now, your idea about the proc files os one I had not thought of. I will have to take a closer look at that tomorrow. Thanks for the idea.

One question (for anyone). Is there ANYONE out there running and hdc filesystem on RedHat 9.0?

Thanks!

(Can we put thyis thread back into the hardware forum?)

slapNUT
12-03-2002, 02:21 PM
You said it works as hdb. Did the drive you took out of hdb work as hdc? Does the CD work as hdc? Does anything work as hdc?

If you answered No No and NO! Then delete /dev/hdc and make a new one.

mknod /dev/hdc -b 22 00

Something like that, I just took the major minor numbers off your post so double check those.

<edit>
mknod /dev/hdc b 22 00
</edit>

pushback
12-06-2002, 08:20 AM
I don't get it.

OK, I made a new device file:

piggy[root]:/dev-> ls -l hdc
brw-rw---- 1 root disk 22, 0 Aug 30 16:31 hdc
piggy[root]:/dev-> mv hdc hdc.orig
piggy[root]:/dev-> mknod /dev/hdc b 22 00
piggy[root]:/dev-> ls -l hdc
brw-r--r-- 1 root root 22, 0 Dec 6 04:27 hdc
piggy[root]:/dev-> cd
piggy[root]:/root-> mount -t ext2 /dev/hdc /u1
mount: /dev/hdc is not a valid block device

However, I can go to the machine, shut it down, change the jumper on the disk so it is slave on IDE2, turn it on and it mounts right up!


piggy[root]:/root-> mount -t ext2 /dev/hdd /u0
piggy[root]:/root-> df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 2063536 981672 977040 51% /
/dev/hda1 23302 11376 10723 52% /boot
/dev/hdb2 117694124 105079640 6635896 95% /bulk
/dev/hda10 33254020 31306504 258284 100% /home
/dev/hda8 4127076 100904 3816528 3% /opt
none 63080 0 63080 0% /dev/shm
/dev/hda7 4127076 32908 3884524 1% /tmp
/dev/hda6 4127076 3507136 410296 90% /usr
/dev/hda11 7746 1068 6278 15% /usr/local
/dev/hda5 4127076 672012 3245420 18% /var
/dev/hda9 3099260 76212 2865616 3% /var/log
/dev/hda3 4127108 90132 3827328 3% /var/spool
/dev/hdd 59088524 41503436 14583568 74% /u0


Arrgh! What's that about?

piggy[root]:/root-> uname -a
Linux piggy 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux


Still refuses to mount as /dev/hdc!

Beneath
12-06-2002, 10:43 AM
Quote from dmesg: "Kernel command line: ro root=LABEL=/ hdc=ide-scsi"

Are you sure you removed the hdc=ide-scsi parameter as said above?

Look in /etc/lilo.conf for a line like:
append="hdc=ide-scsi"
If you have it, just comment it out, and then run:
lilo -v

Reboot, and see if it still happens,

bwkaz
12-06-2002, 11:26 AM
Wait a minute. First, make sure you remove the ide-scsi stuff from the kernel command line, but second, when you changed it over to be hdc, you only moved the jumper on the drive? I have never seen that work -- to make a device be the master, you need to change the jumper and move it to the other connector on the IDE cable. If you didn't do this, do it.

hdc is the secondary master, so you need the drive that you want to be hdc on the secondary channel, at the end of the IDE cable. The secondary slave (hdd) is in the middle of the IDE cable (the same one).

mdwatts
12-06-2002, 05:35 PM
Originally posted by bwkaz
Wait a minute. First, make sure you remove the ide-scsi stuff from the kernel command line, but second, when you changed it over to be hdc, you only moved the jumper on the drive? I have never seen that work -- to make a device be the master, you need to change the jumper and move it to the other connector on the IDE cable. If you didn't do this, do it.

hdc is the secondary master, so you need the drive that you want to be hdc on the secondary channel, at the end of the IDE cable. The secondary slave (hdd) is in the middle of the IDE cable (the same one).

I've never had to physically move a drive to the other IDE connector when switching the master/slave jumpers on both IDE devices.

Only when using cable select.

slapNUT
12-06-2002, 08:38 PM
Quote from dmesg: "Kernel command line: ro root=LABEL=/ hdc=ide-scsi"

Are you sure you removed the hdc=ide-scsi parameter as said above?

Look in /etc/lilo.conf for a line like:
append="hdc=ide-scsi"
If you have it, just comment it out, and then run:
lilo -v

Reboot, and see if it still happens,
Yeah I already posted that the 7th reply on the first page of this thread, but that was never answered.

Also I have suggested he try the CD in hdc and also asked if the CD works as hdc. None of these questions have been answered.

I think I'll try to find someone who wants my help.

bwkaz
12-07-2002, 09:45 AM
Originally posted by mdwatts
I've never had to physically move a drive to the other IDE connector when switching the master/slave jumpers on both IDE devices.

Only when using cable select. Really? Hmm. I remember having problems trying that once, way back when, though I suppose it could have been the cables or the IDE controller. I never tried it since then, just assumed that you needed it on the end of the cable.

Hmm. Whatever.

pushback
12-07-2002, 07:01 PM
Thanks guys.

I do not have an /etc/lilo.conf

I suspect that's because I am bottloading with grub.


Here is my grub.conf

default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14debug)
root (hd0,0)
kernel /vmlinuz-2.4.18-14debug ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14debug.img
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14.img


--
Why is /hdc even mentioned in here? I boot to hda with a swap on hdb.

It does not look like the cd will mount as hdc either. I do not understand why hdc is singled out. Every other device mounts everything fine.

piggy[root]:/-> mount -t iso9660 /dev/hdc /u0
mount: wrong fs type, bad option, bad superblock on /dev/hdc,
or too many mounted file systems
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?)

DMR
12-07-2002, 08:04 PM
Originally posted by pushback
Thanks guys.

I do not have an /etc/lilo.conf

I suspect that's because I am bottloading with grub.


Here is my grub.conf

default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14debug)
root (hd0,0)
kernel /vmlinuz-2.4.18-14debug ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14debug.img
title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14.img


--
Why is /hdc even mentioned in here? I boot to hda with a swap on hdb. Those hdc references are for the ide-scsi emulation, which is only used if you have a CD burner connected as the Secondary Master IDE device (hdc). You will need to remove the "hdc=ide-scsi" instances from grub.conf in order to use the hard drive in the hdc position. You will then have to reboot or manually remove the ide-scsi module by doing:
modprobe -r ide-scsi.

Originally posted by pushback It does not look like the cd will mount as hdc either. I do not understand why hdc is singled out. Every other device mounts everything fine.

piggy[root]:/-> mount -t iso9660 /dev/hdc /u0
mount: wrong fs type, bad option, bad superblock on /dev/hdc,
or too many mounted file systems
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?) [/B]What exactly are you doing here? Are you are you physically switching the CD and hard drive around when you do this? You can't just arbitrarility mount one device in another's position.

Basically, you need to:

1. Remove the ide-scsi references from grub.conf.
2. Make sure that the hard drive is connected to the secondary IDE channel.
3. Make sure the drives jumpers are set to "Master".


:confused:

pushback
12-08-2002, 12:50 AM
OK, I will try removing those references in the grub.conf. Thanks!

My movement of the drives is not arbitrary. I am shutting down the system, changing jumpers and rebooting. No problem with drive management or master slave arrangements--that part I have been playing with for years and years--it's just the hdc bit that has/had be baffled--but this sounds like it may be it.

Did this happen because I had a cd writer in the master position on ide2? I do believe I did have on there at the time I loaded Linux. It's on another machine now. I just want to put four hard drives on this one.

Will let you know if this works. Thanks for all the help.

DMR
12-08-2002, 01:32 AM
Originally posted by pushback
OK, I will try removing those references in the grub.conf. Thanks!

My movement of the drives is not arbitrary. I am shutting down the system, changing jumpers and rebooting. No problem with drive management or master slave arrangements--that part I have been playing with for years and years Sorry, I didn't mean to sound simple or to imply that you didn't know what you were doing; it's just that from the way that you described the troubleshooting you've done I couldn't be sure that you were actually performing all of the right steps (and in the right order), and it never hurts to make sure.

:)


Originally posted by pushback
Did this happen because I had a cd writer in the master position on ide2? I do believe I did have on there at the time I loaded Linux. Yes, that's what happened- if you had a burner installed as the Secondaary Master device (hdc) when you installed Linux, the installation process probably detected that and automagically added the ide-scsi emulation for you.

pushback
12-08-2002, 03:16 AM
Gotchya--no worries dude. Did not take it like that. Trying to determine tone in this medium is tricky as you know. Obviously I don't know everything or I would not be here! How are you to know where my knowledge ends? In this case it ended right around grub.conf ;) ... have not yet had a chance to to try this out but I am pretty sure you hit it... it makes perfect sense. (now!)

Thanks again.

Now, off the topic, I welcome you to treat your eyes-- I just got home from watching STS-113 Endeavour launch a couple of weeks ago from the 3.6 mile Banana River observation area and just put the pics up.

Slideshow of some eye-candy:

http://www.livermore.bz/modules/gallery/slideshow.php?set_albumName=nasa

slapNUT
12-10-2002, 12:00 AM
have not yet had a chance to to try this out but I am pretty sure you hit it

No actually it was "hit" way before that, but you ignored it. BTW you're welcome for for all the time I spent reading all these posts over and over to see if I had missed something. I read every thread on this post at least 3 times thoroughly looking for something I missed.

I really don't mind newbie questions but I do hate when my time is wasted.

pushback
12-10-2002, 03:16 AM
Another mystery solved! You guys are awesome. I am now able to mount /dev/hdc!

Sorry it took so long but piggy (the offfending box) is the storehouse for 10,000 mp3's that my wife is always streaming over smb... so finding a time to shutdown without getting beat up was tricky.

Anyway thanks all.

DMR
12-10-2002, 11:07 PM
Originally posted by pushback
Another mystery solved! You guys are awesome. I am now able to mount /dev/hdc! pushback,

Can you post a description of what finally solved the hdc mystery? Since this thread will become part of the LNO forum archives, it could help other people who have had a similar problem find an answer when they use the "Forum Search" option.

Thanks,

-DMR

:)

slapNUT
12-10-2002, 11:16 PM
Posted by DMR
Can you post a description of what finally solved the hdc mystery? Since this thread will become part of the LNO foum archives, it could help other people who have had a similar problem find an answer when they use the "Forum Search" option. Now I would think this thread could serve as an example to newbies that they should read "thoroughly" the help that is offered by the LNO regulars. So that many people don't waste their time trying to figure out someones problem when the only problem is that the person seeking help didn't thoroughly read the help that was offered.

Yeah I think that hits it on the head.

pushback
12-11-2002, 06:31 PM
Summary/Cause/Solution:

Again, my thanks to all who helped on this one.

Summary: The indications of the problem are an inability to mount a proven good filesystem on an IDE disk to a device. In this case the device was /dev/hdc (Master on IDE controller 2). When the mount command is issued like so:

mount -t ext2 /dev/hdc /u0

The system responds:

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

fdisk, fsck and other disk utilities all give errors indicating the device is invalid. This happens on both RedHat 7.3 & 8.0.

Cause:

This problem will become evident if you install Linux using a CDRW (or other drive that requires SCSI emulation) and you later remove the CDRW and install an IDE device that does not require SCSI emulation (such as an IDE hard drive). After that you will get the error when you try to mount an IDE drive to the same device (driver).

When Linux was installed on this system it was loaded using a CDRW. Apparently, the kernel only really knows how to talk to CDRWs that are SCSI and not IDE, so to compensate a module gets loaded into kernel to talk to the pseudo SCSI device (such as this CDRW). This gets written into your /etc/lilo.conf or (in my case) the /etc/grub.conf, like so:

title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14.img

(note the hdc=ide-scsi reference, causing the kernel to load the ide-scsi emulation for device hdc)

Once the SCSI emulation is in memory the system will not talk to an IDE drive on the device with SCSI emulation indicated in the lilo.conf or grub.conf. This is all been fine if the CDRW is left on that device. However, if you replace hdc with a "normal" IDE drive you wll run into this problem. Since grub.conf is built at install time and is not dynamic, every time you boot the emulation module gets loaded into kernel making it impossible to mount an IDE device unless you change your lilo.conf or grub.conf file (or remove the emulation from the kernel at run time).

Solution:

Edit the /etc/lilo.conf or /etc/grub.conf as appropriate to remove the SCSI emulation argument. If you are not sure if you are booting with lilo or grub, reboot your system (use 'init 6') and watch the messages when the system loads. Before you mess with your lilo.conf or grub.conf make sure you have a boot floppy that works. In my case, I made an additional boot option in my grub.conf in case I screwed up the syntax. That way I could always go back to the old boot line and boot from that if needed.

Removing the SCSI emulation argument from the boot loader line will take care of this. You must reboot for this new syntax to take effect. After you reboot you will be able to issue the mount command above successfully. In my case, the new entry in my grub.conf looks like this:

title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /initrd-2.4.18-14.img

DMR
12-11-2002, 07:22 PM
Ah, so it was the scsi emulation after all.

Thanks for the reply pushback.

Your description of the problem (and its solution) is very succinct and well-written, and you're quite correct in your assumptions concerning CD writers needing to emulate a SCSI device when used in Linux.

:)

bwkaz
12-11-2002, 09:01 PM
Yes, well written!

Just a couple of notes, though. One, even in Windows, CD-R and CD-RW drives use SCSI emulation. But the emulation layer is in the CD writing software in Windows. Not a big deal, just semantics more than anything else. ;)

The other thing is, if you use lilo (and therefore edit /etc/lilo.conf), you will have to run /sbin/lilo as root in order to actually use the changes. Running the lilo executable reinstalls lilo onto either your MBR or your boot record (wherever it's installed currently). Without this reinstallation, the changes you made won't take effect, because of the way that lilo works. grub reads its config file every time it starts up, while lilo doesn't contain filesystem drivers, so it can't read the file.

Glad it works!

pushback
12-11-2002, 10:58 PM
Good point. I should have mentioned that about changes to lilo as I recalled I had to do that when I used lilo... in fact, I was looking around and info and man files to see if I needed to recompile my grub.conf--which I don't. There is a grub command but ut is not used for compiling the conf file as the lilo command is.

Thanks for the input.

DMR
12-12-2002, 06:15 PM
Originally posted by pushback
There is a grub command but ut is not used for compiling the conf file as the lilo command is. The .conf files don't get "compiled", but you've got the right idea: If you use grub it reads grub.conf (or menu.lst) each time you boot, but lilo doesn't read lilo.conf at boot; lilo.conf is only used when you explicitly run /sbin/lilo.

:)

pushback
12-12-2002, 07:46 PM
So when you run lilo, lilo.conf is the input--right? Where does the output go?

mdwatts
12-13-2002, 07:47 AM
The binary /sbin/lilo reads /etc/lilo.conf, parses, checks for errors and then writes what it needs to where you have the Lilo bootloader installed.

Either the mbr or the boot/root partition.

If your /etc/lilo.conf specifies

boot=/dev/hda - then the mbr

boot=/dev/hda# - the boot/root partition

pushback
12-13-2002, 02:20 PM
Ummm... Isn't that what a compiler does? Parse and translate into machine readable form?

DMR
12-13-2002, 10:43 PM
Originally posted by pushback
Ummm... Isn't that what a compiler does? Parse and translate into machine readable form? That is what a compiler does, but there's a fine delineation between compiling source code and what occurs when lilo reads lilo.conf:

A compiler takes its input from statements contained in a source file (written in a given programming language), and creates from that an object file containing machine-readable code.

Lilo, on the other hand, takes as its input the statements in lilo.conf, and writes the output to the boot sector specified in lilo.conf. This can either be the Master Boot Record of the drive, or the boot sector of a given partition.

You could loosely say that lilo.conf does indeed "get compiled", but strictly, a compiler produces a machine-readable output file, while lilo does not; it reads input and writes the result directly to a very low-level section of a hard drive.

:)