Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Conditional Mount?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
deaton
n00b
n00b


Joined: 07 Aug 2002
Posts: 9
Location: mid-Atlantic, USA

PostPosted: Wed Aug 07, 2002 1:16 am    Post subject: Conditional Mount? Reply with quote

This might sound trivial to a sysadmin, but I'm still an ameteur.

I have an external scsi drive (/dev/sdx). I have no problem mounting if it's up and running at boot time, it shows up in /proc/scsi/scsi. However if I bring the drive up post boot, nothing shows up in /proc/scsi/scsi and I can't mount it.

I am using devfs.

Does anyone know a way to test if the external drive is up and running post boot? And how to mount it at that time.

The drive(s) are hot-swappable and I'm not running an automounter (yet).

Ultimately, I'd like to run a cron job that tests if the drive is online, and write a .tbz to it if it is, or abort if it isn't. I just don't know how or what to test for if it's online or not, or even if I can test for it. (except for /proc/scsi/scsi, which only shows up if the drive is up at boot time)
Back to top
View user's profile Send private message
n0n
Guru
Guru


Joined: 13 Jun 2002
Posts: 355

PostPosted: Wed Aug 07, 2002 9:06 pm    Post subject: Reply with quote

Are the SCSI drivers compiled into the kernel, or as modules? Perhaps you could use 'em as modules, and do a modprobe on 'em and see if they'll bring up a drive that way. That's how I can get my hot-swappable CDRom bay on my laptop to work (not using devfs, though) - I rmmod the appropriate module, swap the bay, and then modprobe the module again. Perhaps that'll work in your case?
Back to top
View user's profile Send private message
deaton
n00b
n00b


Joined: 07 Aug 2002
Posts: 9
Location: mid-Atlantic, USA

PostPosted: Thu Aug 08, 2002 11:35 pm    Post subject: Reply with quote

:) thanks!

I new it had to easy. I was loading the scsi modules with /etc/modules.autoload.
I just took it out, added the modprobe statement to my script and viola.
I should of thought of it myself.

Thanks again
Back to top
View user's profile Send private message
deaton
n00b
n00b


Joined: 07 Aug 2002
Posts: 9
Location: mid-Atlantic, USA

PostPosted: Fri Aug 09, 2002 12:27 am    Post subject: Reply with quote

oh yeah!
I also added a rmmod statement at the end of my script so it would work if the drive went offline between (monthly) cron jobs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum