OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: daniel3000 on November 22, 2006, 10:11:19 am

Title: Hda/hdc Assignment
Post by: daniel3000 on November 22, 2006, 10:11:19 am
Hello,

a question:
Where (in pdaXrom 1.1.0beta3) is the logic which recognizes if the Microdrive is /dev/hda or /dev/hdc after bootup (which depends on if a CF flash card is inserted during boot or not)?

Thanks!
daniel
Title: Hda/hdc Assignment
Post by: InSearchOf on November 22, 2006, 10:50:21 am
Darnit!... I could have told you where this is all done... BUT... I'm at work... and I just ssh into my Z... and I installed rc121 just to hack away at it... (booted started wifi interface... thats it)...

Well I just had a clever idea "Let me reboot my Z"

Well the my NIC isn't going to initilize again... so I have no Z access till I get home...  And I sure as hell am not goin to try to talk my wife through configure my wifi card using iwconfig... :-)

Give me a few hours and I will get that answer for you...

Late
Title: Hda/hdc Assignment
Post by: daniel3000 on November 22, 2006, 03:08:21 pm
Thanks a lot... no hurry!  
Title: Hda/hdc Assignment
Post by: wowo123 on November 23, 2006, 08:10:11 am
For me (SL3200) the microdrive is always /dev/hda1 (mounted to /mnt/ide) and the CF-Slot is /dev/hdc1 (mounted to /mnt/cf). To achieve this automatically each time I boot, I use my microdrive with only one large ext3 partition (which allows me also to install programs there in the case I need to. It also holds my swap-file of 128 MB)

Then I had to change the lines in /etc/fstab in the usual way:

/dev/hda1 /mnt/ide auto noauto,owner 0 0
/dev/hdc1 /mnt/cf   auto noauto,owner 0 0

I added another line for using USB-sticks:

/dev/sda1 /mnt/usbstorage auto noauto,owner 0 0  

After next booting all devices are always mounted properly, CF-card inserted or not.
Title: Hda/hdc Assignment
Post by: daniel3000 on November 23, 2006, 09:27:14 am
hmm, but wasn't there this issue with the PCMCIA subsystem assigning /dev/hda to the first recognized IDE drive in the two slots, and since the open slot is the first one, /dev/hda is attached to a CF if inserted and to MD if CF is not inserted during boot?

I also have a line for /dev/hda1 to mount on /mnt/cf in my fstab, but OTOH the device names ARE different, depending on presence of CF card during boot.
It seems the fstab entry is simply not used.

InSearchOf, what's your opinion or knowledge about this?
thanks
daniel
Title: Hda/hdc Assignment
Post by: InSearchOf on November 23, 2006, 11:20:47 am
Well as wowo123 said.. that mount points are always mounted to where they ar specified in fstab... but I would assume just like on a desktop pc... that there are primary and secondary channels... by hardware these are specific as microdrive being primary/master(hda) and cf being secondary/master(hdc)...

If you are having problems with them not matching up let me know... because I dont know if you experienced this yourself or if you overheard(read) this...

I'm still going to look for where these are assigned... I can't find it... or maybe I over looked it...

Late
Title: Hda/hdc Assignment
Post by: daniel3000 on November 23, 2006, 12:19:04 pm
Hi,

I just teted it again.
And yes, the CF card is mounted where fstab points to, that's right:
/dev/hda1 is mounted to /mnt/cf in fstab.
And that's correct: IF there is a CF in the slot during boot, it will be /dev/hda.

If there is no CF in the slot, the MD will be /dev/hda. But in that case, /dev/hda1 is NOT mounted to /mnt/cf (and it cannot, because it is a swap partition here   )

BUT OTOH I have a "swapon /dev/hda1" in an rc script, and that works well if no CF is inserted during boot. However, if there is a CF, this command fails.

So there IS a difference here, dependent on if there is a CF inserted during boot.

/etc/mtab shows:

MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.

Is this not the case on your 1.1.0beta3 installations??

daniel
Title: Hda/hdc Assignment
Post by: InSearchOf on November 23, 2006, 04:12:03 pm
Quote
Hi,

I just teted it again.
And yes, the CF card is mounted where fstab points to, that's right:
/dev/hda1 is mounted to /mnt/cf in fstab.
And that's correct: IF there is a CF in the slot during boot, it will be /dev/hda.

If there is no CF in the slot, the MD will be /dev/hda. But in that case, /dev/hda1 is NOT mounted to /mnt/cf (and it cannot, because it is a swap partition here   )

BUT OTOH I have a "swapon /dev/hda1" in an rc script, and that works well if no CF is inserted during boot. However, if there is a CF, this command fails.

So there IS a difference here, dependent on if there is a CF inserted during boot.

/etc/mtab shows:

MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.

Is this not the case on your 1.1.0beta3 installations??

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147076\"][{POST_SNAPBACK}][/a][/div]

I will do some research on this... I dont have a 3x00... so I dont run into to this problem...

Late
Title: Hda/hdc Assignment
Post by: Meanie on November 23, 2006, 04:30:22 pm
Quote
Hi,

I just teted it again.
And yes, the CF card is mounted where fstab points to, that's right:
/dev/hda1 is mounted to /mnt/cf in fstab.
And that's correct: IF there is a CF in the slot during boot, it will be /dev/hda.

If there is no CF in the slot, the MD will be /dev/hda. But in that case, /dev/hda1 is NOT mounted to /mnt/cf (and it cannot, because it is a swap partition here   )

BUT OTOH I have a "swapon /dev/hda1" in an rc script, and that works well if no CF is inserted during boot. However, if there is a CF, this command fails.

So there IS a difference here, dependent on if there is a CF inserted during boot.

/etc/mtab shows:

MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.

Is this not the case on your 1.1.0beta3 installations??

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147076\"][{POST_SNAPBACK}][/a][/div]

you are right on.

you can check which is which by interrogating /var/lib/pcmcia/stab at bootup and mount the appropiate device, ie hdc or hda and update fstab accordingly
this is done in rc.rofilesys
Title: Hda/hdc Assignment
Post by: InSearchOf on November 23, 2006, 05:16:27 pm
Quote
Quote
Hi,

I just teted it again.
And yes, the CF card is mounted where fstab points to, that's right:
/dev/hda1 is mounted to /mnt/cf in fstab.
And that's correct: IF there is a CF in the slot during boot, it will be /dev/hda.

If there is no CF in the slot, the MD will be /dev/hda. But in that case, /dev/hda1 is NOT mounted to /mnt/cf (and it cannot, because it is a swap partition here   )

BUT OTOH I have a "swapon /dev/hda1" in an rc script, and that works well if no CF is inserted during boot. However, if there is a CF, this command fails.

So there IS a difference here, dependent on if there is a CF inserted during boot.

/etc/mtab shows:

MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.

Is this not the case on your 1.1.0beta3 installations??

daniel
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147076\"][{POST_SNAPBACK}][/a][/div]

you are right on.

you can check which is which by interrogating /var/lib/pcmcia/stab at bootup and mount the appropiate device, ie hdc or hda and update fstab accordingly
this is done in rc.rofilesys
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147101\"][{POST_SNAPBACK}][/a][/div]

Thanks for the clarification... I will check on that tonight... I'm at my brother-in-laws and I'm watchin the Dallas vs. Tampa Bay game (NFL Football for those in in the states)  and right now... The Z is my second priority... :-D

Late
Title: Hda/hdc Assignment
Post by: karlto on November 23, 2006, 08:42:10 pm
Quote
MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.
What if you insert CF after boot? Can you guarantee which is which simply by changing the order in which the startup files load drivers?
Title: Hda/hdc Assignment
Post by: Meanie on November 23, 2006, 09:05:29 pm
Quote
Quote
MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.
What if you insert CF after boot? Can you guarantee which is which simply by changing the order in which the startup files load drivers?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147119\"][{POST_SNAPBACK}][/a][/div]

if you insert CF after boot, it will be hdc because hda has been assigned to MD

the logic is that the first device on the bus will be given hda, the second will be given hdc. this is done dynamically at boot up and handled by the kernel.
Title: Hda/hdc Assignment
Post by: karlto on November 23, 2006, 09:12:14 pm
Quote
Quote
Quote
MD is  /dev/hda if NO CF during boot
MD is /dev/hdc if CF during boot.
What if you insert CF after boot? Can you guarantee which is which simply by changing the order in which the startup files load drivers?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147119\"][{POST_SNAPBACK}][/a][/div]

if you insert CF after boot, it will be hdc because hda has been assigned to MD

the logic is that the first device on the bus will be given hda, the second will be given hdc. this is done dynamically at boot up and handled by the kernel.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=147123\"][{POST_SNAPBACK}][/a][/div]
I guess what I said would have made more sense if they weren't both using the same bus, huh? Sorry...  
Title: Hda/hdc Assignment
Post by: desertrat on November 23, 2006, 10:24:56 pm
Quote
hmm, but wasn't there this issue with the PCMCIA subsystem assigning /dev/hda to the first recognized IDE drive in the two slots, and since the open slot is the first one, /dev/hda is attached to a CF if inserted and to MD if CF is not inserted during boot?
Correct. In a way this behaviour could be useful IFF one can boot from the CF (think of it as on a desktop where you can boot from CD or FDD), but as one cannot boot from CF it's a bloody annoyance.

Quote
I also have a line for /dev/hda1 to mount on /mnt/cf in my fstab, but OTOH the device names ARE different, depending on presence of CF card during boot.
It seems the fstab entry is simply not used.
That's right it doesn't work for me either (C3100 and upto & including beta3). This works for me:

https://www.oesf.org/forums/index.php?showt...=ide\.opts (https://www.oesf.org/forums/index.php?showtopic=16560&hl=ide\.opts)
Title: Hda/hdc Assignment
Post by: daniel3000 on November 24, 2006, 03:28:02 am
Thanks a lot for the info about the stab file, meanie! Now I can automate swap activation correctly!

daniel