Can Volume Name e.g. "Macintosh HD" be obtained via shell?
- From: dave@xxxxxxxxx
- Date: Fri, 9 Dec 2005 00:38:15 +0000 (UTC)
If I do:
$ diskutil info / |grep "Volume Name:"
I can get the volume name of the disk that booted off
but that doesn't necessarily mean it is the internal disk
which I really may want as my standard boot disk.
If I do:
$ diskutil info /dev/disk0s3
am I always guaranteed that slice 3 is the boot partition
and that disk0 is always the internal disk
on any OSX greater than 10.3 that I run this on?
If not, can the internal disk volume name be obtained
in another way? It would be nice to prevent someone from
modifying the internal disk name but I don't really
want to do that anyway.
If I do:
$ pdisk /dev/rdisk0 -dump
I get:
Partition map (with 512 byte blocks) on '/dev/rdisk0'
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_Free 262144 @ 64 (128.0M)
3: Apple_HFS Untitled 312319590 @ 262208 (148.9G)
4: Apple_Free 10 @ 312581798
Device block size=512, Number of Blocks=312581808 (149.1G)
DeviceType=0x0, DeviceId=0x0
Is there anything there that tells me that slice 3 is the boot slice?
If I do:
for d in `df -kt hfs |tail +2 |awk '{print $1}'`; do diskutil info $d; done
I can pipe it to awk with:
$ EOL=$
$ !! | awk "/Volume Name:/,/Protocol: ATA$EOL/"
and with minor manipulation, know that I've got the volume name
of the ATA drive but what if I have two ATA bays (I do on some Macs)?
How can I get the volume name of the ATA drive in bay 0
or is it not do-able?
Thanks for any help.
.
- Follow-Ups:
- Prev by Date: Re: If I bless a FireWire HD ...
- Next by Date: Re: If I bless a FireWire HD ...
- Previous by thread: If I bless a FireWire HD ...
- Next by thread: Re: Can Volume Name e.g. "Macintosh HD" be obtained via shell?
- Index(es):
Relevant Pages
|