A cute CLI trick for emergencies

Cameron Simpson cs at zip.com.au
Wed Dec 7 23:34:21 UTC 2011


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.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Ride with a llama and you never ride alone.
        - Jeff Earls, DoD #0530, <jearls at tekig6.pen.tek.com>


More information about the users mailing list