Ausführliche Erklärung des Befehls parted – Partition

Ausführliche Erklärung des Befehls parted – Partition

1. Wählen Sie die zu partitionierende Festplatte aus, hier ist /dev/sdb

root@ubuntu-virtual-machine:~# parted /dev/sdb 
GNU Parted 3.2
使用 /dev/sdb
欢迎使用 GNU Parted! 输入 'help'可获得命令列表.

2. Erstellen Sie eine Partition

(parted) mklabel                                                          
新的磁盘标签类型? gpt     # (我们要正确分区大于4TB的磁盘,应该使用gpt方式的分区表,输入gpt后回车)

3. Schließen Sie den Partitionsvorgang ab

(parted) mkpart                                                           
分区名称?  []? partb                                                     
文件系统类型?  [ext2]? ext4       #文件类型                                       
起始点? 1    # 1表示从最开始分区,也可以用百分比表示,比如Start? 0% , End? 50%;
结束点? -1   # -1表示到磁盘末尾;也可以分成多个磁盘,写要分配的大小;

4. Überprüfen Sie die Partitionsinformationen

(parted) print                                                            
Model: VMware, VMware Virtual S (scsi)
磁盘 /dev/sdb: 107GB
Sector size (logical/physical): 512B/512B
分区表:gpt
Disk Flags: 

数字  开始:  End    大小   文件系统  Name   标志
 1    1049kB  107GB  107GB  ext4      partb

5. Formatierungsvorgang

root@ubuntu-virtual-machine:~# ll /dev/sdb*
brw-rw---- 1 root disk 8, 16 6月  17 17:05 /dev/sdb
brw-rw---- 1 root disk 8, 17 6月  17 17:05 /dev/sdb1


root@ubuntu-virtual-machine:~# mkfs.ext4 /dev/sdb1
mke2fs 1.44.1 (24-Mar-2018)
创建含有 26213888 个块(每块 4k)和 6553600 个inode的文件系统
文件系统UUID:39f4ef8d-7476-45c4-8807-1a42d0985771
超级块的备份存储于下列块: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872

正在分配组表: 完成                            
正在写入inode表: 完成                            
创建日志(131072 个块) 完成
写入超级块和文件系统账户统计信息: 已完成

6. Mounten Sie die Festplatte

root@ubuntu-virtual-machine:~# mkdir /data1
root@ubuntu-virtual-machine:~# mount /dev/sdb1 /data1/

root@ubuntu-virtual-machine:~# df -h|grep /data1
/dev/sdb1        98G   61M   93G    1% /data1

7. Beitreten/etc/fstab

root@ubuntu-virtual-machine:~# vim /etc/fstab 
root@ubuntu-virtual-machine:~# tail -1 /etc/fstab 
/dev/sdb1        /data1  ext4    defaults 0       0

Ich denke du magst

Origin blog.csdn.net/weixin_43279138/article/details/126997405
Empfohlen
Rangfolge