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。

2、对硬盘进行分区。在终端窗口中输入以下命令:
以下图所示:
在Command (m for help)提示符后面输入m显示一个帮助菜单。

在Command (m for help)提示符后面输入n,执行 add a new partition 指令给硬盘增长一个新分区。
出现Command action时,输入e,指定分区为扩展分区(extended)。
出现Partition number(1-4)时,输入1表示只分一个区。
后续指定起启柱面(cylinder)号完成分区。

在Command (m for help)提示符后面输入p,显示分区表。
系统提示以下:
Device Boot Start End Blocks Id System
/dev/sdb1 1 26108 209712478+ 5 Extended

在Command (m for help)提示符后面输入w,保存分区表。
系统提示:The partition table has been altered!

在终端窗口中输入以下命令:
以下图所示:
系统已经识别了硬盘 /dev/sdb 的分区。

2、硬盘格式化 | Format hard disk
一、显示硬盘及所属分区状况。在终端窗口中输入以下命令:
说明:
-t ext4 表示将分区格式化成ext4文件系统类型。
