Can Volume Name e.g. "Macintosh HD" be obtained via shell?



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.
.



Relevant Pages

  • Re: Relocate Informix database from Raw slices to filesystem
    ... If the device is 'not going to exist anymore' why not dd the data from the ... old slice to the internal disk and then ... >>> So I need a way of relocating the data to a new slice or a filesystem ... I suspect the process will be t ...
    (comp.databases.informix)
  • Anyway to configure more than one KVM boot device?
    ... I am running a number of KVM guests on a physical machine, ... configure the hosts to boot from the network if the internal disk ... I should be able to configure two boot ... Fedora 10 with the latest updates. ...
    (Fedora)
  • Re: Changing the disk a 1200 boots from?
    ... > My Zappo Smartstor has just failed after many years good ... > from the 1200's internal disk but I can't remember how its done. ... > small HD in plastic box with conversion plug - can these be repaired? ... > 2) How do I boot from the internal disk (it works okay once I've booted from ...
    (comp.sys.amiga.hardware)
  • Re: Booting HP-UX 11 server using O.S. on EMC disks
    ... gary burstow wrote: ... > boots from the original OS's on the EMC disks. ... So internal disk are ... > boot time, to be expected really! ...
    (comp.sys.hp.hpux)
  • Re: Simple problem?
    ... > to mess with. ... > I can't get the thing to boot however. ... At the OK prompt, give command ... and "boot disk1" from the 2nd internal disk. ...
    (comp.sys.sun.admin)