ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
功能:对于大于2Tb的磁盘可以用使用parted进行分区,切需要将磁盘转换为GPT格式 语法: parted 【option】【device】 案例: [root@fenfa test]# parted /dev/vdc GNU Parted 2.1 Using /dev/vdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt (parted) mkpart primary 0 200 Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdc: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 200MB 200MB primary (parted) mkpart logical 201 1G (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdc: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 200MB 200MB primary 2 201MB 1000MB 799MB logical (parted) quit Information: You may need to update /etc/fstab. You have mail in /var/spool/mail/root 范例2: 删除分区 [root@fenfa test]# parted /dev/vdc GNU Parted 2.1 Using /dev/vdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdc: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 200MB 200MB primary 2 201MB 1000MB 799MB logical (parted) rm 1 (parted) rm 2 (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdc: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags (parted) quit Information: You may need to update /etc/fstab. You have mail in /var/spool/mail/root 范例3: 非交互创建分区 [root@fenfa test]# parted /dev/vdc mkpart primary 0 500 ignore 创建主分区 Warning: The resulting partition is not properly aligned for best performance. Information: You may need to update /etc/fstab. [root@fenfa test]# parted mkpart logical 501 1G 创建逻辑分区 Error: Could not stat device mkpart - No such file or directory. Retry/Cancel? ^C You have mail in /var/spool/mail/root [root@fenfa test]# parted /dev/vdc mkpart logical 501 1G Information: You may need to update /etc/fstab. [root@fenfa test]# parted /dev/vdc GNU Parted 2.1 Using /dev/vdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdc: 5369MB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 500MB 500MB primary 2 501MB 1000MB 499MB logical