Chinaunix首页 | 论坛 | 博客
  • 博客访问: 183526
  • 博文数量: 55
  • 博客积分: 1471
  • 博客等级: 上尉
  • 技术积分: 420
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-08 14:00
文章分类

全部博文(55)

文章存档

2012年(5)

2011年(50)

分类: LINUX

2011-04-07 14:15:33

Linux parted工具的使用详解
NAME
       GNU Parted - a partition manipulation program(GNU,一种分区管理工具)
SYNOPSIS
       parted [options] [device [command [options...]...]]
OPTIONS
       -h, --help
             displays a help message(输出帮助信息)
       -i, --interactive
               prompts for user intervention(给用户输出提示信息)
       -l, --list
               lists partition layout on all block devices(列出系统所有的分区)
       -m, --machine
               displays machine parseable output(进入parted工具字符操作界面)
       -s, --script
               never prompts for user intervention(不给用户输出提示信息)
       -v, --version
               displays the version(输出parted工具的版本信息)
COMMANDS
       [device] 
       The block device to be used.   When none is given, parted will use the first block device it finds. 给出需要操作的块设备,默认的是第一个块设备。
       [command [options]] 
       Specifies   the   command   to be executed.   If no command is given, parted will present a command prompt.   Possible commands 指定需要执行的命令,若没有指定命令,那么parted就会输出提示信息。可以指定执行的命令如下所示: 
       are: 
          check partition 
          Do a simple check on partition.检查指定分区的文件系统。 
          cp [source-device] source dest 
          Copy the source partition's filesystem on source-device (or the current device if no other device was specified) to the dest partition on the current device.将source指定文件系统从source-device分区上拷贝到dest指定的分区上。如果没有指定source-device,默认就是当前所在的分区。 
          help [command]
          Print general help, or help on command if specified. 输出帮助信息,或者输出指定命令的帮助信息 
          mkfs partition fs-type 
          Make   a   filesystem   fs-type   on partition. fs-type can be one of "fat16", "fat32", "ext2", "linux-swap", or "reis-erfs".在指定的分区上创建一个指定的文件系统。 
          mklabel label-type 
          Create a new disklabel (partition table) of label-type.   label-type should be one of "bsd", "dvh",   "gpt",   "loop","mac", "msdos", "pc98", or "sun".创建一个指定类型的分区表。 
          mkpart part-type [fs-type] start end
          Make a part-type partition with filesystem fs-type (if specified), beginning at start and ending at end (by default in megabytes).   fs-type can be one of "fat16", "fat32", "ext2", "HFS", "linux-swap", "NTFS", "reiserfs", or   "ufs".part-type should be one of "primary", "logical", or "extended".创建一个指定类型的分区,并且还指定了分区的开始地址与结束地址(地址默认的单位是Mb)并且还指定了这个新创建的分区文件系统类型。 
          mkpartfs part-type fs-type start end 
          Make   a part-type partition with filesystem fs-type beginning at start and ending at end (by default in megabytes).功能同上。 
          move partition start end 
          Move partition so that it begins at start and ends at end.   Note: move never changes the minor number.将分区移动到指定的位置,该位置开始点和结束点分别由start和end指定,单位Mb,注意:移动不会改变分区的数字。 
          name partition name 
          Set the name of partition to name. This option works only on Mac, PC98, and GPT disklabels. The name can be   placed in quotes, if necessary.将分区设置为name指定的的名称。该选项仅对Mac,PC98,和GPT磁盘标识有效。如有必要,分区的名称可用于磁盘配额。 
          print   Display the partition table.输出分区信息 
          quit   Exit from parted.退出parted 
          rescue start end 
          Rescue a lost partition that was located somewhere between start and end.   If a partition is found, parted will ask if you want to create an entry for it in the partition table.挽救start到end之间丢失的分区,如果找到,parted就会询问你是否创建一个新的分区到分区表。 
          resize partition start end 
          Resize the filesystem on partition so that it begins at start and ends at end (by default in megabytes).调整指定分区文件系统的大小,按照start和end指定的大小进行调整。 
          rm partition 
          Delete partition.删除指定的分区 
          select device 
          Choose device as the current device to edit. device should usually be a Linux hard disk device, but   it   can   be   a partition, software raid device, or an LVM logical volume if necessary.选择一个指定的设备当作当前的设备去编辑。设备通常是一个Linux物理磁盘设备,也可以是一个分区、一个软raid设备、逻辑卷。 
          set partition flag state 
          Change the state of the flag on partition to state.   Supported flags are: "boot", "root", "swap", "hidden", "raid","lvm", "lba", and "palo".   state should be either "on" or "off".改变分区flag的状态。 
          unit unit
          Set unit as the unit to use when displaying locations and sizes, and for interpreting those given by the user   when not   suffixed   with   an   explicit unit.   unit can be one of "s" (sectors), "B" (bytes), "kB", "MB", "GB", "TB", "%" (percentage of device size), "cyl" (cylinders), "chs" (cylinders柱面, heads磁头,   sectors扇区),   or   "compact"   (megabytes   for input, and a human-friendly form for output).设置指定的单位作为输出的单位,第一个unit是命令关键字,必须只能是unit,第二个unit 可以是s、B、kB、MB、GB、TB、%、cyl、chs、compact。 
          version
          Display version information and a copyright message.输出版本信息
KNOWN ISSUES
       ext3 filesystem resizing does not currently work, please use resize2fs(8) instead.parted还不能调整ext3文件系统的大小,需要用resize2fs替代。
       Resizing   partitions   with an ext3 filesystem will not generally work because of the above issue.   Use resize2fs(8) to resize the filesystem and resize the partition manually using fdisk(8) or a similar tool.   For LVM situations, you will need to use the   LVM   commands to resize the LVM elements.

原文地址:

阅读(1812) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~