[X-Unix] Renaming "NO NAME" Flash Disks

Stroller MacMonster at myrealbox.com
Wed Jan 5 22:57:27 PST 2005


On Jan 6, 2005, at 5:22 am, Jerry Krinock wrote:
>
>> A drive knows its name by the filesystem label. How is your drive 
>> formatted?
>
> Here is the relevant excerpt of the output from "diskutil list":
>
> /dev/disk3
>    #:                   type name               size      identifier
>    0: FDisk_partition_scheme                    *252.0 MB disk3
>    1:             DOS_FAT_16 NO NAME            251.7 MB  disk3s1> --
>
> Back to my question, how can I change the name?

The normal way to change disks' volume names is to use Disk Utility - 
you can format them there & give them a new name. The option to format 
in FAT is not available there, however, so I believe `diskutil` to be 
the correct way.


> I tried typing:
>
> diskutil rename disk3 MyDisk
>
> and it thought about that for 5 seconds or so, and did not return an 
> error,
> but nothing got renamed.  I don't want to fool around with diskutil 
> too much
> since I'm scared I'll screw something up real bad.

Looing at `man diskutil` I think you got the order of "disk3" & 
"MyDisk" the wrong way around. If your flash disk is of the USB-key 
type & has no data on it, then you're safe to experiment because you 
can always plug it in to a friend's PC to reformat it in FAT or FAT32. 
I don't think this'll be necessary, tho'.

NAME
      diskutil - Modify, verify and repair local disks.

SYNOPSIS
      diskutil verb [options]
...
VERBS
      Each verb is listed with its description and individual arguments.

      list [device]
                 List the partitions of a disk or all disks.  If no 
device is
                 listed, than all partitions on all disks will be 
displayed.
...
      rename name device
                 Rename a volume.
...
      eraseVolume format name device
                 Erase an existing volume.  Format discussed below.  
Ownership
                 of the affected disk is required.
...
DEVICES
      A device parameter to any of the above commands (except where 
explicitly
      defined otherwise) is any of the following
      The device node entry.  Any entry of the form of /dev/disk*.  ex.
      /dev/disk2
      The disk identifier.  Any entry of the form of disk*.  ex.  disk1s9
      The volume mount point.  Any entry of the form of 
/Volumes/Mountpoint.
      ex.  /Volumes/Untitled


I was reading this to check the format of diskutil's commands - I was 
going to suggest trying `diskutil eraseDisk MS-DOS MyDisk disk3` to 
format & rename, but I think something like `diskutil rename MyDisk 
/dev/diskX ` might well do it - check which disk it is by using 
`diskutil list`.

Stroller.



More information about the X-Unix mailing list