系统管理指南:设备和文件系统

格式化磁盘

磁盘通常由制造商或转售商进行格式化。在安装驱动器时,通常无需重新格式化磁盘。

必须已对磁盘进行格式化后才能执行以下操作:


注意 – 注意 –

格式化磁盘是一个破坏性过程,因为它覆写磁盘上的数据。由于此原因,磁盘通常仅由制造商或转售商进行格式化。如果认为磁盘缺陷是导致某个问题反复出现的原因,则可以使用 format 实用程序执行表面分析。但是,应非常谨慎地仅使用不会破坏数据的命令。


Procedure如何确定磁盘是否已格式化

  1. 成为超级用户或承担等效角色。

  2. 调用 format 实用程序。


    # format
    

    将显示可用磁盘的编号列表。

  3. 键入要检查的磁盘的编号。


    Specify disk (enter its number): 0
    
  4. 通过查看以下消息,验证所选磁盘是否已格式化:


    [disk formatted]

示例 12–2 确定磁盘是否已格式化

以下示例说明磁盘 c1t0d0 已格式化。


# format /dev/rdsk/c1*

AVAILABLE DISK SELECTIONS:

       0. /dev/rdsk/c1t0d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@0,0

       1. /dev/rdsk/c1t1d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@1,0

       2. /dev/rdsk/c1t8d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@8,0

       3. /dev/rdsk/c1t9d0s0 <SUN18G cyl 7506 alt 2 hd 19 sec 248>

          /sbus@2,0/QLGC,isp@2,10000/sd@9,0

Specify disk (enter its number): 0

selecting /dev/rdsk/c1t0d0s0

[disk formatted]

Procedure如何格式化磁盘

  1. 成为超级用户或承担等效角色。

  2. 调用 format 实用程序。


    # format
    

    将显示可用磁盘的编号列表。

  3. 键入要格式化的磁盘的编号。


    Specify disk (enter its number): 0
    

    注意 – 注意 –

    请勿选择系统磁盘。如果格式化系统磁盘,则会删除此磁盘上的 OS 和任何数据。


  4. 要开始格式化磁盘,请在 format> 提示符下键入 format。通过键入 y 确认该命令。


    format> format
    
    Ready to format.  Formatting cannot be interrupted
    
    and takes 23 minutes (estimated). Continue? yes
    
  5. 通过查看以下消息,验证磁盘格式化是否已成功:


    Beginning format. The current time Tue ABC xx xx:xx:xx xxxx
    
    
    
    Formatting...
    
    done
    
    
    
    Verifying media...
    
            pass 0 - pattern = 0xc6dec6de
    
       2035/12/18  
    
    
    
            pass 1 - pattern = 0x6db6db6d
    
       2035/12/18  
    
    
    
    Total of 0 defective blocks repaired.
  6. 退出 format 实用程序。


    format> quit
    

示例 12–3 格式化磁盘

以下示例说明如何格式化磁盘 c0t6d0


# format

Searching for disks...done





AVAILABLE DISK SELECTIONS:

       0. c0t0d0 <SUNW18G cyl 7506 alt 2 hd 19 sec 248

          /pci@1f,0/pci@1,1/scsi@2/sd@0,0

       1. c0t1d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@1,0

       2. c0t2d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@2,0

       3. c0t3d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@3,0

       4. c0t4d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@4,0

       5. c0t5d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@5,0

       6. c0t6d0 <FUJITSU  MAN3367M SUN36G  1804 43d671f>

          /pci@1f,0/pci@1,1/scsi@2/sd@6,0

Specify disk (enter its number): 6

selecting c0t6d0

[disk formatted]

format> format

Ready to format.  Formatting cannot be interrupted

and takes 332 minutes (estimated). Continue? y

Beginning format. The current time is Wed Jan  7 16:16:05 2004



Formatting...

   99% complete (00:00:21 remaining) done



Verifying media...

        pass 0 - pattern = 0xc6dec6de

   71132922  



        pass 1 - pattern = 0x6db6db6d

   71132922  



Total of 0 defective blocks repaired.

format> quit