Re: [osol-discuss] Finding external USB disks

2007-12-13 Thread Tirthankar
I'm looking to check for the presence of
various devices in a script run in cron, so the device may not have been
connected *recently*. 

You can use rmformat and store the o/p in a file
Next time you run rmformat, diff it with the old o/p
stored in the file. 
If there are any differences, then you parse further to 
find out if a device was added recently 

Thanks,
Tirthankar
 
 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-13 Thread David Dyer-Bennet
Tirthankar wrote:
 I'm looking to check for the presence of
 various devices in a script run in cron, so the device may not have been
 connected *recently*. 
 

 You can use rmformat and store the o/p in a file
 Next time you run rmformat, diff it with the old o/p
 stored in the file. 
 If there are any differences, then you parse further to 
 find out if a device was added recently 
   

Yes, but none of that output gives me any clue which drive is attached!  
The closest to any identification info is the manufacturer and part 
number, but since I'm starting this project with two brand-new identical 
drives, that doesn't help distinguish them in the least!

-- 
David Dyer-Bennet, [EMAIL PROTECTED]; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-13 Thread W. Wayne Liauh
 What are the approaches to finding what external USB
 disks are currently 
 connected?  

What's wrong with 

$ iostat -En

?
 
 
This message posted from opensolaris.org
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-13 Thread David Dyer-Bennet
W. Wayne Liauh wrote:
 What are the approaches to finding what external USB
 disks are currently 
 connected?  
 

 What's wrong with 

 $ iostat -En

 ?
   

There, I learned another thing. That's always good.

I don't immediately grasp how it's a good solution to my problem, 
though.  It appears to be listing the removable drive under every drive 
designation it's ever been connected as (which changes depending on 
which USB port it's plugged in to and perhaps what else was also plugged 
in at that time), so it doesn't give me a unique pointer to the drive. 
It also doesn't give me any usable identifying information on the drive, 
just the manufacturer and model (my system needs to handle two 
*different* drives of the *same* model; in fact they're arriving 
tomorrow). 

So I've got c4t0d0p0, c5t0d0p0, and c5t0d0p0 all reporting a WDC 
WD1600JB.  But that's really all the same drive.  And there's a serial 
number field in the output, but it's blank in all three cases (if that 
were filled in I could tell *which drive* it was).


-- 
David Dyer-Bennet, [EMAIL PROTECTED]; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


[osol-discuss] Finding external USB disks

2007-12-12 Thread David Dyer-Bennet
What are the approaches to finding what external USB disks are currently 
connected?   I'm starting on backup scripts, and I need to check which 
volumes are present before I figure out what to back up to them.  I 
suppose I could just try all the ones that I know about and see which 
are there (the list is small enough this is actually feasible), but it's 
inelegant.  (On Solaris Nevada, currently build 76 I think).

The external USB backup disks in question have ZFS filesystems on them, 
which may make a difference in finding them perhaps?

I've glanced at Tim Foster's autobackup and related scripts, and they're 
all about being triggered by the plug connection being made; which is 
not what I need.  I don't actually want to start the big backup when I 
plug in (or power on) the drive in the evening, it's supposed to wait 
until late (to avoid competition with users).  (His autosnapshot script 
may be just what I need for that part, though.)

-- 
David Dyer-Bennet, [EMAIL PROTECTED]; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-12 Thread Anil Gulecha
On 12/13/07, David Dyer-Bennet [EMAIL PROTECTED] wrote:
 What are the approaches to finding what external USB disks are currently
 connected?   I'm starting on backup scripts, and I need to check which
 volumes are present before I figure out what to back up to them.  I
 suppose I could just try all the ones that I know about and see which
 are there (the list is small enough this is actually feasible), but it's
 inelegant.  (On Solaris Nevada, currently build 76 I think).

 The external USB backup disks in question have ZFS filesystems on them,
 which may make a difference in finding them perhaps?

 I've glanced at Tim Foster's autobackup and related scripts, and they're
 all about being triggered by the plug connection being made; which is
 not what I need.  I don't actually want to start the big backup when I
 plug in (or power on) the drive in the evening, it's supposed to wait
 until late (to avoid competition with users).  (His autosnapshot script
 may be just what I need for that part, though.)


You can try 'rmformat' to see all removable media connected.

Also try 'dmesg' after connecting the device.

~Anil
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-12 Thread Ignacio Marambio Catán
On Dec 13, 2007 12:35 AM, David Dyer-Bennet [EMAIL PROTECTED] wrote:
 What are the approaches to finding what external USB disks are currently
 connected?   I'm starting on backup scripts, and I need to check which
 volumes are present before I figure out what to back up to them.  I
 suppose I could just try all the ones that I know about and see which
 are there (the list is small enough this is actually feasible), but it's
 inelegant.  (On Solaris Nevada, currently build 76 I think).

 The external USB backup disks in question have ZFS filesystems on them,
 which may make a difference in finding them perhaps?

 I've glanced at Tim Foster's autobackup and related scripts, and they're
 all about being triggered by the plug connection being made; which is
 not what I need.  I don't actually want to start the big backup when I
 plug in (or power on) the drive in the evening, it's supposed to wait
 until late (to avoid competition with users).  (His autosnapshot script
 may be just what I need for that part, though.)

there is cfgadm i guess, check cfgadm_usb(1M)

nacho
___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org


Re: [osol-discuss] Finding external USB disks

2007-12-12 Thread David Dyer-Bennet
Anil Gulecha wrote:
 On 12/13/07, David Dyer-Bennet [EMAIL PROTECTED] wrote:
   
 What are the approaches to finding what external USB disks are currently
 connected? 
 You can try 'rmformat' to see all removable media connected.
 

Ah, that's looking useful.  Thanks also to those who pointed out cfgadm.

Now, what's that Label reported by rmformat?  It's unknown in all 
the examples I have to try.   Is this something I can set with rmformat 
or fdisk or something?  So that I could recognize the volumes by a 
string I applied to it myself? 

Or are there serial numbers accessible on USB hard drives that I can get 
access to?  That would be a unique identifier for each drive, and I 
could store those and use those to recognize which ones were mounted.

 Also try 'dmesg' after connecting the device.
 
That last doesn't fit my model, I'm looking to check for the presence of 
various devices in a script run in cron, so the device may not have been 
connected *recently*. 

-- 
David Dyer-Bennet, [EMAIL PROTECTED]; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org