# blkid -pi -c /dev/null /dev/sda MINIMUM_IO_SIZE=512 PHYSICAL_SECTOR_SIZE=512 LOGICAL_SECTOR_SIZE=512 PTTYPE=dos # blkid -c /dev/null /dev/mapper/srv-lvol0: UUID="ff838430-4058-47a4-abf8-91362eb57ba1" TYPE="ext3" /dev/mapper/VolGroup00-LogVol01: TYPE="swap" /dev/mapper/VolGroup00-LogVol02: UUID="2ba64b56-9c0c-40e1-a17b-c1bfe2040007" TYPE="ext3" /dev/mapper/VolGroup00-LogVol00: UUID="c22f3324-8c93-4bd3-b376-eed363e0c15f" TYPE="ext3" /dev/cciss/c0d4: UUID="07bc6be5-6f4e-409a-940c-b5ba398dd7b5" TYPE="ext4" /dev/cciss/c0d0p1: LABEL="/boot" UUID="0cfeec27-0c44-4991-a2cb-1e881dfb98c3" TYPE="ext3" /dev/VolGroup00/LogVol00: UUID="c22f3324-8c93-4bd3-b376-eed363e0c15f" TYPE="ext3" /dev/VolGroup00/LogVol01: TYPE="swap" /dev/loop0: LABEL="NOLABEL" TYPE="iso9660" /dev/loop1: LABEL="RMO_CDROM" TYPE="iso9660" /dev/mapper/mpath4: UUID="07bc6be5-6f4e-409a-940c-b5ba398dd7b5" TYPE="ext4" /dev/mapper/mpath29p1: LABEL="ORADATA001" TYPE="oracleasm" /dev/mapper/mpath16p1: UUID="79028217-73cf-497c-bcb4-2bde1cbebdeb" SEC_TYPE="ext2" TYPE="ext3" /dev/mapper/mpath18p1: UUID="e361ac4f-a9d3-4250-a14c-1cac6881844f" SEC_TYPE="ext2" TYPE="ext3" /dev/loop2: LABEL="INST_CD" TYPE="iso9660"
file(1) can print details about certain devices in the /dev/ directory (block devices in this example). This helped me to know at a glance the location and revision of my bootloader, UUIDs, filesystem status, which partitions were primaries / logicals, etc.. without running several commands.
See also:
file -s /dev/dm-*
file -s /dev/cciss/*
etc..
Show Sample Output
Shows all block devices in a tree with descruptions of what they are.
Another alternative to blkid, lsblk, file -s, cat /proc/paritions, fdisk -l, etc.. Show Sample Output
List all disks and all of their partitions on OS X. http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/diskutil.8.html Show Sample Output
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: