利用parted查看分区列表

parted是一个gnu的分区工具,比fdisk更强大。比如查看机器上硬盘的分区情况,parted显式的信息更加详细, 包含分区类型,分区大小,文件系统类型等。在我的机器上,parted显式的分区列表为:

首先键入parted /dev/sda , 然后键入print all来列出分区表。另外,可以用help列出可用的分区命令等。

xuyang@xuyang-desktop:~/blog$ sudo parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all                                                        
Model: ATA WDC WD3200AAJS-5 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  100GB  100GB   primary   ntfs            boot
 2      100GB   320GB  220GB   extended
 5      100GB   316GB  216GB   logical   ext4
 6      316GB   320GB  4292MB  logical   linux-swap(v1)


Model: ATA ST31000333AS (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  210GB   210GB   primary   fat32           lba
 2      210GB   315GB   105GB   primary   ntfs            boot
 3      315GB   629GB   315GB   primary   ntfs
 4      629GB   1000GB  371GB   extended
 5      629GB   985GB   356GB   logical   ext4
 6      985GB   994GB   9286MB  logical   linux-swap(v1)
 7      994GB   1000GB  6152MB  logical   swsusp

(parted) help
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partition NUMBER
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
  resizepart NUMBER END                    resize partition NUMBER
  move NUMBER START END                    move partition NUMBER
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all
                                           found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER START END                  resize partition NUMBER and its file system
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU
                                           Parted

另外,如果只要查看分区情况可以使用sudo parted -l命令。



本文地址: http://www.bagualu.net/wordpress/archives/5390 转载请注明




发表评论

电子邮件地址不会被公开。 必填项已用*标注