Linux4.3 parted partitioned GPT format

Source: Internet
Author: User

The Fdisk partitioning tool, which has a partition format of MBR, is characterized by a maximum of 4 primary partitions and a disk size not exceeding 2T. and the GPT partition format, break through these restrictions, it does not have a primary partition, extended partition, logical partition of the points, on a disk can be divided into 128 partitions, support more than 2T partition, the maximum volume up to 18EB. 

  Parted tools Common features:

When entering parted on the command line, enter the interactive mode of the parted command. Enter Help to display the assistance information. The following is a brief introduction of the commonly used functions 1, check the file system simple. It is recommended to check the file system with other commands, such as Fsck2, help display helper Information 3, Mklabel create partition table, that is, use MSDOS (MBR) or GPT, or other way partition Table 4, MKFS create file system. The command does not support the EXT3 format, so it is recommended that you do not use it, preferably with parted, and then exit parted interactive mode, partitioning with other commands such as Mkfs.ext35, Mkpart to create a new partition. Format: Mkpart part-type [Fs-type] The START endpart-type type mainly has primary (primary partition), extended (extended partition), logical (logical zone). Extended partitions and logical partitions are only for MSDOS. Fs-type file system type, mainly has the start and end position of the start end partition such as FS32,NTFS,EXT2,EXT3. 6, Mkpartfs establish the partition and its file system. The ext3 file system is not currently supported and is not recommended for use. Finally, after the area is divided, exit parted and then use other commands to create the file system. 7, print output partition information. This feature has 3 options, free displays all information about the disk, and displays the amount of space left for the specified partition. All displays all disk information 8, resize adjusts the size of the specified partition. Currently support for EXT3 format is not very good, so it is not recommended to use this feature. 9, rescue recover accidentally deleted partition. If you accidentally delete a partition with the parted RM command, you can recover through the rescue feature. You need to give the location of the start and end of the partition when recovering. The parted is then searched within a given range and prompts to recover the partition. 10, RM delete partition. The command format is RM number. For example, RM 3 is to delete the partition numbered 3 11, select Device. When you enter the parted command and enter the interactive mode, if you have more than one hard disk, select the hard drive you want to operate with select. such as: SELECT/DEV/SDB12, set flag. Change the flag for the specified partition number. The flags are usually as follows: Boot hidden raid LVM, etc. Boot is boot partition, hidden is hidden partition, RAID soft RAID,LVM is logical partition. Example: Set 3 Boot on setting partition number 3 is the boot partition note: The above content is commonly used in parted, because the tool is currently not very good for ext3 support, so some features can not be applied, such as move (mobile partition) and resize. 

 

[[email protected] ~]# parted/dev/sdb #一定要输入硬盘名字, the default is to operate the first HDD GNU parted 3.1 using/dev/sdbwelcome to GNU parted! Type ' help ' to view a list of commands. (parted) Mklabel #定义分区类型, is it MBR or GPT? What is the new disk label type?  GPT (parted) Mkpart #创建新分区分区名称? []?  Chyuanliu file system type? [Ext2]? Ext4 starting point? 1 #单位是MB结束点? Parted Pmodel:vmware, VMware Virtual S (SCSI) disk/dev/sdb:10.7gbsector size (logical/physical): 512b/512bpartiti               On Table:gptdisk flags:number Start End Size File system Name flag 1 1049kB 1000MB 999MB Chyuanliu (parted) Mkpart chyuanliu1 XFS 1001 #也可以一起写 (parted) Pmodel:vmware, VMware Virtual S (SCSI) disk/dev/ Sdb:10.7gbsector size (logical/physical): 512b/512bpartition table:gptdisk flags:number Start End size File sys TEM Name Flag 1 1049kB 1000MB 999MB chyuanliu 2 1001MB 2000MB 998MB Chyuan LIU1 (parted) RM 1 (parted) Pmodel: VMware, VMware Virtual S (SCSI) disk/dev/sdb:10.7gbsector size (logical/physical): 512b/512bpartition table:gptdisk Fla Gs:number Start End Size File system Name flag 2 1001MB 2000MB 998MB chyuanliu1 (parted Quit #保存退出 # format and mount after partition [[email protected] ~]# mkfs.ext4/dev/sdb1[[email protected] ~]# mount/dev/sd b1/tmp/chyuanliu1/#使用fdisk-L/DEV/SDB will find that the disk type becomes GPT instead of DOS

Create an interactive partition.

[[email protected] ~]# free-m       Total used       free     shared    buffers     cachedmem:           987        220         766          6          2         74-/+ buffers/cache:        143        843Swap:         2999          0       2999[[email Protected] ~]# parted/dev/sdb Mkpart swap 2001 3000 info: You could need to update/etc/fstab. [[email protected] ~]# MKSWAP/DEV/SDB3 setting swap space version 1, size = 975868 KiB no tag, uuid=b7afaabd-8b90-4e03-b10c-3bbb4745192a[[ Email protected] ~]# swapon! $swapon/dev/sdb3[[email protected] ~]# free-m             total       used       free     shared    buffers     cachedmem:           987        221        765          6          2         74-/+ buffers/cache:        145        842Swap:         3952          0       3952# If the system is automatically mounted/DEV/SDB3 this swap partition, you need to manually edit the/etc/fstab file. and add the following at the end of the file: #/dev/sdb3             swap    defaults        0 0

Restores the partition that was mistakenly deleted.

[[email protected] ~]# parted/dev/sdb mkpart ext4 3001 4000 Info: You could need to update/etc/fstab. [[email protected] ~]# mkfs.ext4/dev/sdb4mke2fs 1.42.9 (28-dec-2013) file System label =os type:linux block Size =4096 (log=2) chunking size = 4096 (log=2) stride=0 blocks, Stripe width=0 blocks61056 inodes, 243968 blocks12198 blocks (5.00%) reserved for the super U Ser First Data Block =0maximum filesystem blocks=2516582408 block groups32768 blocks per group, 32768 fragments per group7632 inodes p Er groupsuperblock backups stored on blocks:32768, 98304, 163840, 229376Allocating Group tables: Completion writing Inode table: Complete C  Reating Journal (4096 blocks): Complete writing Superblocks and filesystem accounting Information: complete [[email protected] ~]# Fdisk-l/dev/sdbwarning:fdisk GPT Support are currently new, and therefore in an experimental phase. Use at your own discretion. Disk/dev/sdb:10.7 GB, 10737418240 bytes, 20,971,520 sectors units = Sector of 1 * total = bytes sector size (logical/physical): 51  2 Bytes/512 bytes I/o size (min/best): 512 Bytes/512 bytes disk label type: gpt# Start        End Size Type Name 1 2048 1953791 953M Microsoft basic CHYUANLIU1 2 1955840 3905535 952M Microsoft Basic Swap 3 3907584 5859327 953M Microsoft Basic Swap 4 5861376 78 13119 953M Microsoft Basic ext4[[email protected] ~]# parted/dev/sdb RM 4 Info: May need to update/etc/fstab.[ [email protected] ~]# fdisk-l/dev/sdbwarning:fdisk GPT support are currently new, and therefore in an experimental Phase. Use at your own discretion. Disk/dev/sdb:10.7 GB, 10737418240 bytes, 20,971,520 sectors units = Sector of 1 * total = bytes sector size (logical/physical): 51 2 Bytes/512 bytes I/o size (min/best): 512 Bytes/512 bytes disk label type: gpt# Start End Size type Name 1 2 048 1953791 953M Microsoft basic CHYUANLIU1 2 1955840 3905535 952M Microsoft basic Swap 3 3907 584 5859327 953M Microsoft basic swap[[email protected] ~]# PARTED/DEV/SDB rescue 3001 4000 searching file system ... 49% (Time remaining 00:01) information: A EXT4 Primary partition is found at 3001MB-4000MB. Does want to addit to the partition table? is/yes/no/no/give up/cancel? Yes information: may need to update/etc/fstab.  [[email protected] ~]# fdisk-l/dev/sdbwarning:fdisk GPT support are currently new, and therefore in an experimental Phase. Use at your own discretion. Disk/dev/sdb:10.7 GB, 10737418240 bytes, 20,971,520 sectors units = Sector of 1 * total = bytes sector size (logical/physical): 51 2 Bytes/512 bytes I/o size (min/best): 512 Bytes/512 bytes disk label type: gpt# Start End Size type Name 1 2 048 1953791 953M Microsoft basic CHYUANLIU1 2 1955840 3905535 952M Microsoft basic Swap 3 3907 584 5859327 953M Microsoft Basic Swap 4 5861376 7813119 953M Microsoft Basic

  

Linux4.3 parted partitioned GPT format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.