如何將硬盤分區成GPT格式

      網友投稿 1518 2025-03-31

      基于GPT格式的磁盤分區

      MBR分區標準決定了MBR的硬盤,為了支持能使用大于2T硬盤空間,需使用GPT格式進行分區。創建大于2TB的分區,需使用parted工具。

      MBR是Master Boot Record的簡稱,也就是主引導記錄,是位于磁盤最前邊的一段引 導(Loader)代碼,主要用來引導操作系統的加載與啟動

      特點:

      MBR支持最大2TB磁盤,它無法處理大于2TB容量的磁盤

      只支持最多4個主分區。若想要更多分區,需要創建擴展分區,并在其中創建邏輯分區

      GPT磁盤是指使用GUID分區表的磁盤,GUID磁盤分區表(GUID Partition Table,縮寫:GPT)其含義為“全局唯一標識磁盤分區表”,是一個實體硬盤的分區表的結構布局的標準

      特點:

      GPT對磁盤大小沒有限制

      最多可以創建128個分區

      在企業真實環境中,通常一臺服務器有多塊硬盤,整個硬盤容量為10T,需要基于GTP格式對10T硬盤進行分區,操作步驟如下:

      確認是否有parted命令

      [root@localhost ~]# which parted /usr/sbin/parted 這里安裝的有,我們直接使用 [root@localhost ~]# [root@localhost ~]# yum -y install parted 如果沒有,需要安裝parted 命令

      1

      2

      3

      4

      Parted 命令分為兩種模式:命令行模式和交互模式。

      命令模式:

      parted -s /dev/sdb mklabel gpt 設置分區類型為gpt格式; mkfs.ext3 /dev/sdb 基于Ext3文件系統類型格式化; mount /dev/sdb /data/ 掛載/dev/sdb設備至/data/目錄。

      1

      2

      3

      4

      交互模式:

      parted 直接進入 select /dev/sdb 選擇/dev/sdb磁盤 mklabel gpt 格式類型為gpt mkpart primary 0 -1 將整塊磁盤分一個分區 print 打印剛分區的磁盤信息 quit 退出 mkfs.ext3 /dev/sdb1 格式化磁盤 moun /dev/sdb1 /data/ 掛在

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      詳細操作情況

      [root@localhost ~]# parted GNU Parted 3.1 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p #打印磁盤信息 Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 1049kB 211MB 210MB primary xfs boot 2 211MB 751MB 540MB primary lvm 3 751MB 32.2GB 31.5GB primary xfs (parted) select /dev/sdb #選擇空的磁盤 Using /dev/sdb (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 21.5GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags (parted) mklabel gpt #用GPT分區,支持2T以上的硬盤 Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes 輸入yes (parted) mkpart primary 0 -1 -1 #將整塊磁盤分為1個分區 1表示從最開始分區,也可以用百分比表示 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? Ignore/Cancel? ignore (parted) print #打印剛分好的分區 Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 21.5GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 21.5GB 21.5GB primary (parted) quit

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      16

      17

      18

      19

      20

      21

      22

      23

      24

      25

      26

      27

      28

      29

      30

      31

      32

      33

      34

      35

      36

      37

      38

      39

      40

      41

      42

      43

      44

      45

      46

      47

      48

      將磁盤分成多個分區

      (parted) mkpart primary File system type? [ext2]? ext4 #選擇文件系統類型 Start? 1024 #分區開始位置 End? 2048 #分區結束位置 Error: Partition(s) 1, 2, 3 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? ignore (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1024MB 2048MB 1023MB primary (parted) mkpart primary File system type? [ext2]? ext3 Start? 0 End? 1023 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore Error: Partition(s) 1, 2, 3 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? ignore (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 2 17.4kB 1023MB 1023MB primary 1 1024MB 2048MB 1023MB primary (parted) mkpart exclude File system type? [ext2]? ext3 Start? 2049 End? 4096 Error: Partition(s) 1, 2, 3 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use. As a result, the old partition(s) will remain in use. You should reboot now before making further changes. Ignore/Cancel? ignore (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sda: 32.2GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 2 17.4kB 1023MB 1023MB primary 1 1024MB 2048MB 1023MB primary 3 2049MB 4096MB 2047MB exclude (parted)

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      16

      17

      18

      19

      20

      21

      22

      23

      24

      25

      26

      27

      28

      29

      30

      31

      32

      33

      34

      35

      如何將硬盤分區成GPT格式

      36

      37

      38

      39

      40

      41

      42

      43

      44

      45

      46

      47

      48

      49

      50

      51

      52

      53

      54

      55

      56

      57

      58

      59

      60

      61

      62

      63

      如果創建錯誤,需要刪除錯誤分區

      (parted) select /dev/sdb Using /dev/sdb (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 21.5GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 21.5GB 21.5GB primary (parted) rm 1 (parted) p

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      總結

      磁盤格式化、掛載 參考上期文章 linux 磁盤分區管理

      linux磁盤分區管理

      Linux

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:如何用excel制作抽獎券(如何用Excel制作抽獎券)
      下一篇:excel表格中怎么制作部門評分的雷達圖表?
      相關文章
      亚洲成色999久久网站| 久久精品亚洲中文字幕无码网站| 亚洲视频中文字幕在线| 在线观看亚洲精品国产| 亚洲国产精品一区二区九九| 国产成人亚洲综合a∨| 亚洲AV一区二区三区四区| 亚洲成在人线在线播放无码| 亚洲人成人无码.www石榴 | 亚洲另类古典武侠| 亚洲日韩国产精品无码av| 亚洲国产精品人久久电影| 亚洲人成网站18禁止久久影院| 亚洲人成网站日本片| 亚洲 暴爽 AV人人爽日日碰| 国产亚洲玖玖玖在线观看| 亚洲美国产亚洲AV| 国产精品日本亚洲777| 亚洲AV中文无码乱人伦在线视色| 亚洲人成网站观看在线播放| 在线观看亚洲精品福利片| 亚洲国产精品无码久久久秋霞2| 亚洲AV无码专区电影在线观看| 亚洲AV日韩AV鸥美在线观看| 久久亚洲AV成人无码国产| 亚洲图片中文字幕| 亚洲午夜精品久久久久久app| 亚洲国产美女精品久久久| 日韩亚洲国产综合久久久| 亚洲午夜AV无码专区在线播放 | 国产亚洲AV夜间福利香蕉149| 亚洲人成网77777色在线播放| 亚洲成在人线av| 亚洲视频一区在线播放| 亚洲综合丁香婷婷六月香| 亚洲人成色4444在线观看| 亚洲精品视频免费观看| 亚洲色无码专区在线观看| 91精品国产亚洲爽啪在线观看| 亚洲乱码一二三四区乱码| 亚洲AV成人无码网站|