Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 磁碟掛載完整指南:fdisk (MBR) 與 parted (GPT/大於 2TB) 實戰

編輯:Linux 教學

MBR 分區表僅支援 2TB 以下磁碟,超過 2TB 必須使用 GPT 分區表與 parted 工具。本文整理兩種情境的完整操作流程。

一、小於 2TB 磁碟:使用 fdisk (MBR)

fdisk /dev/xvdb
# 依序輸入:n → p → 1 → Enter → Enter → w
mkfs.ext4 /dev/xvdb1
mkdir /myidata
mount /dev/xvdb1 /myidata
echo "/dev/xvdb1 /myidata ext4 defaults 0 0" >> /etc/fstab

二、大於 2TB 磁碟:使用 parted (GPT)

parted /dev/vdc
# 互動模式下依序執行:
mklabel gpt
unit TB
mkpart primary 0 3
print
quit

mkfs.ext4 /dev/vdc1
mount /dev/vdc1 /home
echo "/dev/vdc1 /home ext4 defaults 0 0" >> /etc/fstab

三、關鍵差異對照

項目fdisk (MBR)parted (GPT)
最大支援容量2 TB9.4 ZB
分區數量限制4 主分區128 預設
工具支援所有 Linux現代 Linux 皆支援

四、驗證掛載

df -hT /mount/point
lsblk -f

依據磁碟容量選擇正確工具與分區表,並寫入 /etc/fstab 實現開機自動掛載。

Copyright © Windows教程網 All Rights Reserved