fmthard(8) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

fmthard(8)

fmthard(8)              System Administration Commands              fmthard(8)

NAME
       fmthard - modify or clear label on a device

SYNOPSIS
       fmthard [-d data | -n volume_name | -s sfile]
            [-e] [-f] [-i] /dev/rdsk/c?[t?]d?[s?]


       fmthard -c /dev/rdsk/c?[t?]d?[s?]

DESCRIPTION
       The  fmthard command modifies or clears three types of device partition
       labels: MBR (Master Boot Record), GPT/EFI (UEFI's  GUID  Partition  Ta‐
       ble), and VTOC (Volume Table of Contents).


       To  request  modifications  to  a  label, one or more of the options -s
       sfile, -d  data, or -n  volume_name must be used. To clear all  labels,
       the  -c  option  must  be  used.  To print a label, see prtvtoc(8). The
       /dev/rdsk/c?[t?]d?[s?] file must be the character special file  of  the
       device.


       An  MBR  label  is  only  used  on x86 systems, and is required on each
       legacy (non-UEFI) x86 boot device. A device can only have one  MBR  la‐
       bel, located at logical-block-address LBA 0 (no backup). An MBR can di‐
       rectly describe four separate partitions, all within the first two ter‐
       abytes  of  a  device. An MBR is created during install or by fdisk(8).
       For a MBR labeled device, Solaris supports whole-device access via  the
       c?[t?]d?p0  name. Access to the four MBR partitions is provided via the
       p1-4 names. Only one MBR partition can be flagged Bootable/Active.


       A GPT label can be used on both x86 and SPARC systems. While a GPT  la‐
       bel  can  be used on any size device, a GPT label is required to repre‐
       sent a whole-device size over two terabytes. A device can only have one
       GPT label, located at LBA 1 (with backup label at the end  of  the  de‐
       vice). A GPT label supports 128 non-overlapping partitions, however So‐
       laris  only  supports  a subset of these (see below). For a GPT labeled
       device, Solaris supports whole-device access via the c?[t?]d? name  (no
       s#): which maps to the driver's "wd,raw" (partition 7) minor node. This
       whole-device  access  is a driver construct, and is not actually repre‐
       sented in the on-disk GPT label.


       A legacy VTOC label can be used on both x86 and SPARC systems when  the
       whole-device size is under two terabytes. A VTOC label's partitions are
       sometimes  referred  to  as slices. On x86 do not confuse a VTOC parti‐
       tion/slice created by fmthard labeling with the MBR partitions  created
       by  fdisk.  Both SPARC and x86 support a backup label at the end of the
       device. On SPARC a VTOC label is located at LBA 0. On x86 a VTOC  label
       is  located  at  LBA  1, leavinbg room for MBR at LBA 0. On legacy x86,
       when an device is MBR labeled, each MBR partition can have its own VTOC
       sub-label, with all VTOC sub-label partitions existing within  the  LBA
       confines  of  a  single  MBR partition. Only the VTOC on the single MBR
       partition flagged Bootable/Active is used. For VTOC  labeling,  defini‐
       tion  of  overlapping partitions is permitted, but discouraged: the ex‐
       ception being the default s2  whole-device  partition.  For  a  non-MBR
       VTOC  labeled  device, by convention, Solaris supports whole-device ac‐
       cess via the c?[t?]d?s2 name; which maps to the "c,raw" minor node.


       Both GPT and VTOC labels share similar x86 .vs SPARC limitations on the
       number of partitions/slices Solaris supports. For SPARC, both  GPT  and
       VTOC  labels support 8 partitions, 0−7: even though the partition field
       has 4 bits, only 3 bits are currently used. For x86, both GPT and  VTOC
       labels supports 16 partitions (all 4 bits are used).


       When  a device is unlabeled, a default label that provides whole-device
       access is constructed (but not automatically written  to  the  device).
       When the whole-device size is under two terabytes, a default VTOC label
       is formed. The -e option can be used to force a GPT default label. In a
       default  VTOC  label,  the  whole-device  s2  partition's tag will be 5
       (V_BACKUP).


       When modifying a VTOC label, it is recommended you  leave  the  default
       label s2 definition unchanged.


       On  x86  systems,  fdisk(8) must be run before fmthard can write a VTOC
       label.

OPTIONS
       The following options are supported:

       -c

           On the specified device, this option  will  zero  all  primary  and
           backup sectors containing label information: MBR, acronym>/GPT/EFI,
           and VTOC.


       -d data

           The  data  argument of this option is a string representing the in‐
           formation for a particular partition  in  the  current  label.  The
           string  must  be of the format partition:tag:flags:start:size where
           partition is the partition number, tag is the ID TAG of the  parti‐
           tion,  flags are the permission flags, start is the starting sector
           number of the partition, and size is the number of sectors  in  the
           partition. See the description of -s  sfile below for more informa‐
           tion on these fields.


       -e

           Force write of a GPT/EFI label instead of a VTOC label.


       -f

           Force  the  writing of the label even if the device contains an un‐
           mounted file system or exported zfs(4fs) pool.


       -i

           This option allows the command to create  the  desired  label,  but
           prints  the  information to standard output instead of actually la‐
           beling the device.


       -n volume_name

           This option is used to give the device a volume_name up to 8  char‐
           acters long.


       -s sfile

           This option is used to populate the label according to a sfile cre‐
           ated  by  the  user.  If  sfile is − (a hyphen), fmthard reads from
           standard input. For an unlabeled device,  if  sfile  is  /dev/null,
           then  the  default  label is written. This option causes all of the
           partition timestamp fields to be set to zero. The sfile  format  is
           described below.

           The sfile typically contains one specification line for each parti‐
           tion/slice,  starting with partition 0. Each line is delimited by a
           new-line character (\n). If the first character of a line is an as‐
           terisk (*), the line is treated as a comment. Each line is composed
           of entries that are position-dependent, separated  by  white  space
           and having the following format:

           partition tag flags start size

           where the entries have the following values:


           partition

               The partition number.


           tag

               The partition tag: a decimal number. The following are reserved
               codes:  0 (V_UNASSIGNED), 1 (V_BOOT), 2 (V_ROOT), 3 (V_SWAP), 4
               (V_USR), 5 (V_BACKUP), 6 (V_STAND), 7 (V_VAR), 8  (V_HOME),  12
               (V_SYSTEM), and 24 (V_BIOS_BOOT).


           flags

               The  flags field allows a partition to be marked as unmountable
               or read only, the flag bits  are:  V_UNMNT  0x01,  and  V_RONLY
               0x10. For a mountable partition use 0x00.


           start

               The sector number (decimal) on which the partition starts.


           size

               The number (decimal) of sectors occupied by the partition.

           You  can  save  the output of a prtvtoc command to a file, edit the
           file, and use it as the sfile argument to the -s  option.  You  can
           also  pipe the output of prtvtoc into fmthard using '-s  −'. Due to
           differences in overlap rules, conversion of VTOC to GPT via  -e  is
           unlikely to work.


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os


ENVIRONMENT VARIABLES
       NOINUSE_CHECK    When set, all non-mandatory checks are disabled.  With
                        this  set, fmthard silently writes labels even when it
                        will result in the loss of  data  and  or  the  system
                        crashing.


SEE ALSO
       uname(1), zfs(4fs), attributes(7), format(8), prtvtoc(8)

   x86 Only
       fdisk(8)

NOTES
       Special  care  should be exercised when overwriting an existing labels,
       as incorrect use could result in current data being inaccessible. As  a
       precaution, save the old VTOC.

Oracle Solaris 11.4               29 May 2025                       fmthard(8)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3