Device does not contain a recognized partition table.
The size of this disk is 3.7 TiB (4000787030016 bytes). DOS partition table format can not be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).spa
Created a new DOS disklabel with disk identifier 0x721e33d2..net
終端輸入 sudo fdisk -l 查看機器上都插了哪些安裝盤,看到/dev/sda,而且沒有進行分區且大小爲3.7T,是要掛載的硬盤。
$ sudo fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb091dbe9
Device Boot Start End Sectors Size Id Type
/dev/nvme0n1p1 * 2048 498116607 498114560 237.5G 83 Linux
/dev/nvme0n1p2 498118654 500117503 1998850 976M 5 Extended
/dev/nvme0n1p5 498118656 500117503 1998848 976M 82 Linux swap / Solaris
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 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
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: 0x2ef87b1f
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 1126399 1124352 549M 7 HPFS/NTFS/exFAT
/dev/sdb2 1128446 3907028991 3905900546 1.8T 5 Extended
/dev/sdb5 1128448 3874134015 3873005568 1.8T 83 Linux
/dev/sdb6 3874136064 3907028991 32892928 15.7G 82 Linux swap / Solaris
Partition 2 does not start on physical sector boundary.
而後運行以下命令:
sudo parted /dev/sda #進入parted
mklabel gpt #將磁盤設置爲gpt格式,
mkpart logical 0 -1 #將磁盤全部的容量設置爲GPT格式
print #查看分區結果
這個時候應該是默認進行分了一個/dev/sda1這個分區
而後退出parted,在終端輸入 sudo mkfs.ext4 -F /dev/sda1
將剛剛分出來的sda1格式化爲ext4的格式,而後就能夠設置開機自動掛載了。
二、設置開機自動掛載
查看硬盤/dev/sda1 對應的UUID
sudo blkid
注意: 惟一的sda1的UUID號。
再事先準備好一個地方來作掛載點,好比我這裏是/DATA4T而後再用命令打開配置文件:
終端輸入 sudo vim /etc/fstab
而後在文件末尾添加
UUID=7941f2c5-d582-4414-85c5-6d199a701795 /DATA4T ext4 defaults 0 0
最後重啓電腦。
因爲/DATA4T 是在根目錄下,爲便於操做,需將其用戶屬性從 root改爲 普通用戶。
附錄:
經常使用相關命令:
lsblk -f
能夠查看硬盤UUID
fdisk -l
查看硬盤
mkfs.ext4 /dev/vdb
格式化硬盤
blkid
查看磁盤的UUID
參考:
在Ubuntu 16.04下使用GPT分區並掛載硬盤(主要)
sudo fdisk /dev/sdb分區 操做詳解
1、硬盤分區 | Hard disk add new partition
一、顯示硬盤及所屬分區狀況。在終端窗口中輸入以下命令:
顯示當前的硬盤及所屬分區的狀況。以下圖所示:
系統提示:DIsk /dev/sdb doesn't contain a valid partition table。
![1522291142953258.gif 1.gif](http://static.javashuo.com/static/loading.gif)
2、對硬盤進行分區。在終端窗口中輸入以下命令:
以下圖所示:
在Command (m for help)提示符後面輸入m顯示一個幫助菜單。
![1522291150631562.gif 2.gif](http://static.javashuo.com/static/loading.gif)
在Command (m for help)提示符後面輸入n,執行 add a new partition 指令給硬盤增長一個新分區。
出現Command action時,輸入e,指定分區爲擴展分區(extended)。
出現Partition number(1-4)時,輸入1表示只分一個區。
後續指定起啓柱面(cylinder)號完成分區。
![1522291159502739.gif 3.gif](http://static.javashuo.com/static/loading.gif)
在Command (m for help)提示符後面輸入p,顯示分區表。
系統提示以下:
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 5 Extended
![1522291166220638.gif 4.gif](http://static.javashuo.com/static/loading.gif)
在Command (m for help)提示符後面輸入w,保存分區表。
系統提示:The partition table has been altered!
![1522291175167083.gif 5.gif](http://static.javashuo.com/static/loading.gif)
在終端窗口中輸入以下命令:
以下圖所示:
系統已經識別了硬盤 /dev/sdb 的分區。
![1522291184648789.gif 6.gif](http://static.javashuo.com/static/loading.gif)
2、硬盤格式化 | Format hard disk
一、顯示硬盤及所屬分區狀況。在終端窗口中輸入以下命令:
說明:
-t ext4 表示將分區格式化成ext4文件系統類型。
![1522284674305157.png 7.png](http://static.javashuo.com/static/loading.gif)