show all unmounted disk labels?
how does one show all unmounted disk labels. say i have a disk, and im guessing that its /dev/sda2. how can i take away this guessing.
|
Looking at /dev/disk/by-label/ (or use 'disktype') will show you all disklabels, to see which ones are unmounted check against /proc:
Code:
for DISKLABEL in `find /dev/disk/by-label/ -type l`; do RES=`readlink -f $DISKLABEL`; |
unSpawn has a great solution. I am not very good with code however, so usually I run (as root):
Code:
fdisk -l Hope this simple command helps! |
Code:
blkid -c /dev/null Some of the other suggestions are of no use to me unfortunately. Some distros of Linux don't have the /dev/disk/by-label/ directory (mine doesn't) so that can't be used. fdisk -l doesn't show labels (at least it doesn't on mine). There are various tools that let you ask a drive what its label is (e2label, mlabel, ntfslabel, etc.) but they generally require that you know which device it is, which is often difficult in the case of USB drives. Also, they require you to know what format the drive is in. gparted will display the label, but it is a slow and cumbersome solution and doesn't lend itself to automation. |
All times are GMT -5. The time now is 08:35 PM. |