硬盤在linux下分區格式化命令


2T硬盤在linux命令行分區格式化方法:

 小結如下:
1、sudo fdisk -l 2、sudo fdisk /dev/sdb p (分區) d(刪除原有分區) p(分區) n(新分區) p(主分區) +800G p(分區) n p p w 3、格式化 sudo mkfs.ntfs /dev/sdb1 sudo mkfs.ntfs /dev/sdb2
原始操作記錄:

emy@emy-test:~$ sudo fdisk -l Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 18386107-FBE9-405F-AB5D-8F2114A142D6 設備 Start 末尾 扇區 Size 類型 /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 960419839 959369216 457.5G Linux filesystem /dev/sda3 960419840 976771071 16351232 7.8G Linux swap Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 設備 啟動 Start 末尾 扇區 Size Id 類型 /dev/sdb1 2048 3907029167 3907027120 1.8T 83 Linux emy@emy-test:~$ sudo fdisk /dev/sdb Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. 命令(輸入 m 獲取幫助): p Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 設備 啟動 Start 末尾 扇區 Size Id 類型 /dev/sdb1 2048 3907029167 3907027120 1.8T 83 Linux 命令(輸入 m 獲取幫助): d Selected partition 1 Partition 1 has been deleted. 命令(輸入 m 獲取幫助): 1 1: unknown command 命令(輸入 m 獲取幫助): p Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 命令(輸入 m 獲取幫助): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p 分區號 (1-4, default 1): First sector (2048-3907029167, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029167, default 3907029167): 800G Value out of range. Last sector, +sectors or +size{K,M,G,T,P} (2048-3907029167, default 3907029167): +800G Created a new partition 1 of type 'Linux' and of size 800 GiB. 命令(輸入 m 獲取幫助): p Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 設備 啟動 Start 末尾 扇區 Size Id 類型 /dev/sdb1 2048 1677723647 1677721600 800G 83 Linux 命令(輸入 m 獲取幫助): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): p 分區號 (2-4, default 2): First sector (1677723648-3907029167, default 1677723648): Last sector, +sectors or +size{K,M,G,T,P} (1677723648-3907029167, default 3907029167): Created a new partition 2 of type 'Linux' and of size 1 TiB. 命令(輸入 m 獲取幫助): p Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 設備 啟動 Start 末尾 扇區 Size Id 類型 /dev/sdb1 2048 1677723647 1677721600 800G 83 Linux /dev/sdb2 1677723648 3907029167 2229305520 1T 83 Linux 命令(輸入 m 獲取幫助): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. emy@emy-test:~$ sudo fdisk -l Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 18386107-FBE9-405F-AB5D-8F2114A142D6 設備 Start 末尾 扇區 Size 類型 /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 960419839 959369216 457.5G Linux filesystem /dev/sda3 960419840 976771071 16351232 7.8G Linux swap Disk /dev/sdb: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb14807c7 設備 啟動 Start 末尾 扇區 Size Id 類型 /dev/sdb1 2048 1677723647 1677721600 800G 83 Linux /dev/sdb2 1677723648 3907029167 2229305520 1T 83 Linux

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM