[root@iZ8vba689kou8r8sq4yw44Z ~]# parted /dev/vdbGNU Parted 3.2Using /dev/vdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) printModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3221GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags(parted) mklabel gptWarning: The existing disk label on /dev/vdb will be destroyed and all data on this disk will be lost. Do youwant to continue?Yes/No? qparted: invalid token: qYes/No? No(parted) helpalign-check TYPE N check partition N for TYPE(min|opt) alignmenthelp [COMMAND] print general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkpart PART-TYPE [FS-TYPE] START END make a partitionname NUMBER NAME name partition NUMBER as NAMEprint [devices|free|list,all|NUMBER] display the partition table, available devices, free space, allfound partitions, or a particular partitionquit exit programrescue START END rescue a lost partition near START and ENDresizepart NUMBER END resize partition NUMBERrm NUMBER delete partition NUMBERselect DEVICE choose the device to editdisk_set FLAG STATE change the FLAG on selected devicedisk_toggle [FLAG] toggle the state of FLAG on selected deviceset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion display the version number and copyright information of GNU Parted(parted) help mkpartmkpart PART-TYPE [FS-TYPE] START END make a partitionPART-TYPE is one of: primary, logical, extendedFS-TYPE is one of: btrfs, nilfs2, ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp,linux-swap(v1), linux-swap(v0), ntfs, reiserfs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs, amufs5,amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5, affs4, affs3, affs2, affs1,affs0, linux-swap, linux-swap(new), linux-swap(old)START and END are disk locations, such as 4GB or 10%. Negative values count from the end of thedisk. For example, -1s specifies exactly the last sector.'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may bespecified to set an appropriate partition ID.(parted) mkpart primary 1 1T(parted) printModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3221GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags1 1049kB 1000GB 1000GB primary(parted) align-checkalign-check help mktable quit resizepart set versiondisk_set mklabel name rescue rm toggledisk_toggle mkpart print resize select unit(parted) align-check opt 11 aligned(parted) printModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3221GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags1 1049kB 1000GB 1000GB primary(parted) quitInformation: You may need to update /etc/fstab.[root@iZ8vba689kou8r8sq4yw44Z ~]# mkfs.xfs /dev/vvcs vcs4 vcsa1 vcsa5 vdb vhci vport1p1vcs1 vcs5 vcsa2 vcsa6 vdb1 vhost-netvcs2 vcs6 vcsa3 vda vfio/ vhost-vsockvcs3 vcsa vcsa4 vda1 vga_arbiter virtio-ports/[root@iZ8vba689kou8r8sq4yw44Z ~]# mkfs.xfs /dev/vdb1mkfs.xfs: /dev/vdb1 appears to contain an existing filesystem (xfs).mkfs.xfs: Use the -f option to force overwrite.[root@iZ8vba689kou8r8sq4yw44Z ~]# lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTvda 253:0 0 40G 0 disk└─vda1 253:1 0 40G 0 part /vdb 253:16 0 3T 0 disk└─vdb1 253:17 0 931.3G 0 part[root@iZ8vba689kou8r8sq4yw44Z ~]# partprobe[root@iZ8vba689kou8r8sq4yw44Z ~]# mkfs.xfs /dev/vdb1mkfs.xfs: /dev/vdb1 appears to contain an existing filesystem (xfs).mkfs.xfs: Use the -f option to force overwrite.[root@iZ8vba689kou8r8sq4yw44Z ~]# mkfs.xfs -f /dev/vdb1meta-data=/dev/vdb1 isize=512 agcount=4, agsize=61035072 blks= sectsz=512 attr=2, projid32bit=1= crc=1 finobt=1, sparse=1, rmapbt=0= reflink=1data = bsize=4096 blocks=244140288, imaxpct=25= sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0, ftype=1log =internal log bsize=4096 blocks=119209, version=2= sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0[root@iZ8vba689kou8r8sq4yw44Z ~]# parted /dev/vdbGNU Parted 3.2Using /dev/vdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) print freeModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3221GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags17.4kB 1049kB 1031kB Free Space1 1049kB 1000GB 1000GB xfs primary1000GB 3221GB 2221GB Free Space(parted) mkpart test 1000GB 100%(parted) printModel: Virtio Block Device (virtblk)Disk /dev/vdb: 3221GBSector size (logical/physical): 512B/512BPartition Table: gptDisk Flags:Number Start End Size File system Name Flags1 1049kB 1000GB 1000GB xfs primary2 1000GB 3221GB 2221GB test(parted) quitInformation: You may need to update /etc/fstab.[root@iZ8vba689kou8r8sq4yw44Z ~]# mkfs.xfs -f /dev/vdb2meta-data=/dev/vdb2 isize=512 agcount=4, agsize=135572800 blks= sectsz=512 attr=2, projid32bit=1= crc=1 finobt=1, sparse=1, rmapbt=0= reflink=1data = bsize=4096 blocks=542291200, imaxpct=5= sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0, ftype=1log =internal log bsize=4096 blocks=264790, version=2= sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0[root@iZ8vba689kou8r8sq4yw44Z ~]# fdisk -lDisk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: dosDisk identifier: 0x951dd9eeDevice Boot Start End Sectors Size Id Type/dev/vda1 * 2048 83886046 83883999 40G 83 LinuxDisk /dev/vdb: 3 TiB, 3221225472000 bytes, 6291456000 sectorsUnits: sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisklabel type: gptDisk identifier: 470E1DEF-DE79-403E-814C-0FD8F649FFC4Device Start End Sectors Size Type/dev/vdb1 2048 1953124351 1953122304 931.3G Linux filesystem/dev/vdb2 1953124352 6291453951 4338329600 2T Linux filesystem[root@iZ8vba689kou8r8sq4yw44Z ~]# blkid/dev/vda1: UUID="a135856a-aaa1-40b1-96cd-e77e01ccf728" TYPE="xfs" PARTUUID="951dd9ee-01"/dev/vdb1: UUID="b55442f8-0bba-493d-a4b7-38234ed044a6" TYPE="xfs" PARTLABEL="primary" PARTUUID="4ce0f3b1-cbd0-41d2-b60e-ebc34edf38d8"/dev/vdb2: UUID="32c7dfc0-8de4-47be-9a6f-04e4b3d6105e" TYPE="xfs" PARTLABEL="test" PARTUUID="68527707-f2e2-423e-a5eb-b8b98fe35f21"[root@iZ8vba689kou8r8sq4yw44Z ~]# df -hFilesystem Size Used Avail Use% Mounted ondevtmpfs 396M 0 396M 0% /devtmpfs 411M 0 411M 0% /dev/shmtmpfs 411M 472K 411M 1% /runtmpfs 411M 0 411M 0% /sys/fs/cgroup/dev/vda1 40G 2.6G 38G 7% /tmpfs 83M 0 83M 0% /run/user/0[root@iZ8vba689kou8r8sq4yw44Z ~]# mount /dev/vdb1 /data[root@iZ8vba689kou8r8sq4yw44Z ~]# mount /dev/vdb2 /data[root@iZ8vba689kou8r8sq4yw44Z ~]# df -hFilesystem Size Used Avail Use% Mounted ondevtmpfs 396M 0 396M 0% /devtmpfs 411M 0 411M 0% /dev/shmtmpfs 411M 472K 411M 1% /runtmpfs 411M 0 411M 0% /sys/fs/cgroup/dev/vda1 40G 2.6G 38G 7% /tmpfs 83M 0 83M 0% /run/user/0/dev/vdb2 2.1T 15G 2.1T 1% /data
apfs扩容_linux GPT分区及扩容
最新推荐文章于 2024-05-09 21:15:30 发布