什么是parted

发布时间:2016-12-8 16:00:20 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"什么是parted",主要涉及到什么是parted方面的内容,对于什么是parted感兴趣的同学可以参考一下。

1. 什么是parted parted是一个磁盘分区管理管理工具,它比fdisk更加灵活,功能也更丰富,同时还支持GUID分区表(GUID Partition Table), 这在IA64平台上管理磁盘时非常有用。 2. parted的作用 parted同时支持交互模式和非交互模式. 它除了能够进行分区的添加,删除等常见操作外,还可以移动分区, 制作文件系统, 调整文件系统大小, 复制文件系统. 3. 使用parted 删除一个分区 命令格式: parted device rm partition 实例: 删除分区/dev/sda1 [[email protected] ~]# parted /dev/sda print Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 10.0GB 10.0GB primary ext3 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 Information: Don't forget to update /etc/fstab, if necessary. [[email protected] ~]# parted /dev/sda rm 1 Information: Don't forget to update /etc/fstab, if necessary. [[email protected] ~]# parted /dev/sda print Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 Information: Don't forget to update /etc/fstab, if necessary. 添加一个分区 命令格式: parted device mkpart part-type [fs-type] start end 实例: 添加一个大小为3GB的主分区 [[email protected] ~]# parted /dev/sda mkpart primary 32.3kB 3GB [[email protected] ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 3002MB 3002MB primary ext3 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 制作文件系统 命令格式: parted device mkfs 实例: 对刚刚添加的分区制作文件系统。 [[email protected] ~]# parted /dev/sda mkfs Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue? Yes/No? y Partition number? 1 File system? [ext2]? Information: Don't forget to update /etc/fstab, if necessary. [[email protected] ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 3002MB 3002MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 调整文件系统大小 命令格式: parted device resize partition start end 实例: 将分区/dev/sda1的大小增加到5GB。 [[email protected] ~]# parted /dev/sda resize 1 32.3kB 5GB Warning: You should reinstall your boot loader before rebooting. Read section 4 of the Parted User documentation for more information. Information: Don't forget to update /etc/fstab, if necessary. [[email protected] ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 5001MB 5001MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 移动分区 命令格式: parted device move partition start end 实例: 移动分区/dev/sda1 [[email protected] ~]# parted /dev/sda move 1 5001MB End? [10.0GB]? Warning: You should reinstall your boot loader before rebooting. Read section 4 of the Parted User documentation for more information. Information: Don't forget to update /etc/fstab, if necessary. [[email protected] ~]# parted /dev/sda print -s Model: MAXTOR ATLAS10K5_73SCA (scsi) Disk /dev/sda: 73.6GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 5001MB 10.0GB 5001MB primary ext2 4 12.1GB 73.6GB 61.5GB extended 5 12.1GB 20.4GB 8390MB logical ext3 6 20.4GB 32.1GB 11.6GB logical ext3 7 32.1GB 73.6GB 41.5GB logical ext3 注意: 不同于fdisk命令的使用w功能来确认来写入分区表信息, parted命令执行后立即生效,因此输入时需要谨慎.

上一篇:手机充电科学小解
下一篇:mysql show processlist分析

相关文章

关键词: 什么是parted

相关评论