A cute CLI trick for emergencies

Aaron Konstam akonstam at sbcglobal.net
Thu Dec 8 15:27:23 UTC 2011


On Thu, 2011-12-08 at 10:34 +1100, Cameron Simpson wrote: 
> On 07Dec2011 10:44, Joe Zeff <joe at zeff.us> wrote:
> | On 12/07/2011 06:18 AM, Robert Nichols wrote:
> | > An issue with both the fdisk and blkid solutions is that they will spin
> | > up every sleeping drive on your system.  Looking at the output from dmesg
> | > won't do that.
> | 
> | I tried dmesg first but never found anything useful in it.
> 
> There should be a sequence like the below when you plug in a USB drive:
> 
>   usb-storage: device found at 5
>   usb-storage: waiting for device to settle before scanning
>   scsi 9:0:0:0: Direct-Access     WD       My Book 1110     1030 PQ: 0
>   ANSI: 4
>   sd 9:0:0:0: Attached scsi generic sg7 type 0
>   scsi 9:0:0:1: CD-ROM            WD       Virtual CD 1110  1030 PQ: 0
>   ANSI: 4
>   sd 9:0:0:0: [sdf] 1952151552 512-byte hardware sectors: (999 GB/930 GiB)
>   sd 9:0:0:0: [sdf] Write Protect is off
>   sd 9:0:0:0: [sdf] Mode Sense: 23 00 10 00
>   sd 9:0:0:0: [sdf] Assuming drive cache: write through
>   sr0: scsi3-mmc drive: 51x/51x caddy
>   sr 9:0:0:1: Attached scsi CD-ROM sr0
>   sr 9:0:0:1: Attached scsi generic sg8 type 5
>   scsi 9:0:0:2: Enclosure         WD       SES Device       1030 PQ: 0
>   ANSI: 4
>   scsi 9:0:0:2: Attached scsi generic sg9 type 13
>   sd 9:0:0:0: [sdf] Assuming drive cache: write through
>    sdf: sdf1
>   usb-storage: device scan complete
>   sd 9:0:0:0: [sdf] Attached SCSI disk
> 
> And thus the drive is /dev/sdf, with the data partition /dev/sdf1.
> 
> You may need to scroll back a bit if a lot of stuff is going on in
> dmesg.
> 
Great, but could the displaying of the information be made more obscure?

-- 
=======================================================================
The luck that is ordained for you will be coveted by others.
=======================================================================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam at sbcglobal.net



More information about the users mailing list