虚拟机分区
磁盘分区详细步骤 01,检察详细的磁盘环境 # lsblk -p NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT /dev/sda 8:0 0 100G 0 disk ├─/dev/sda1 8:1 0 500M 0 part /boot └─/dev/sda2 8:2 0 99.5G 0 part ├─/dev/mapper/centos-root 253:0 0 73.5G 0 lvm / ├─/dev/mapper/centos-swap 253:1 0 16G 0 lvm └─/dev/mapper/centos-home 253:2 0 10G 0 lvm /home /dev/sdb 8:16 0 100G 0 disk /dev/sr0 11:0 1 4.4G 0 rom02,进行分区 # parted /dev/sdb GNU Parted 3.1 Using /dev/sdb Welcome to GNU Parted! Type 'help' to view a list of commands. #把磁盘设置成gpt 模式 (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? yes (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 107GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags
第一个磁盘分区
(parted) mkpart cinder 0 20G Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore (parted) print Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 107GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 17.4kB 20.0GB 20.0GB cinder
#第二个磁盘分(parted) mkpart swfit 20 40G Warning: You requested a partition from 20.0MB to 40.0GB (sectors 39062..78125000). The closest location we can manage is 20.0GB to 40.0GB (sectors 39062501..78125000). Is this still acceptable to you? Yes/No? yes Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 107GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 17.4kB 20.0GB 20.0GB cinder 2 20.0GB 40.0GB 20.0GB swfit
第三个磁盘分区
(parted) mkpart manila 40 60G Warning: You requested a partition from 40.0MB to 60.0GB (sectors 78125..117187500). The closest location we can manage is 40.0GB to 60.0GB (sectors 78125001..117187500). Is this still acceptable to you? Yes/No? yes Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore (parted) p Model: VMware, VMware Virtual S (scsi) Disk /dev/sdb: 107GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 17.4kB 20.0GB 20.0GB cinder 2 20.0GB 40.0GB 20.0GB swfit 3 40.0GB 60.0GB 20.0GB manila
生存退出 (parted) q Information: You may need to update /etc/fstab.
03,格式化分区 # mkfs -t xfs /dev/sdb mkfs.xfs: /dev/sdb appears to contain a partition table (gpt). mkfs.xfs: Use the -f option to force overwrite. # mkfs -t xfs /dev/sdb1 meta-data=/dev/sdb1 isize=512 agcount=4, agsize=1220702 blks = sectsz=512 attr=2, projid32bit=1 =
crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=4882808, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 # mkfs -t xfs /dev/sdb2 meta-data=/dev/sdb2 isize=512 agcount=4, agsize=1220703 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=4882812, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 # mkfs -t xfs /dev/sdb3 meta-data=/dev/sdb3 isize=512 agcount=4, agsize=1220703 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=4882812, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
04,增补,删除分区 过程 # lsblk -p NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT /dev/sda 8:0 0 100G 0 disk ├─/dev/sda1 8:1 0 500M 0 part /boot └─/dev/sda2 8:2 0 99.5G 0 part ├─/dev/mapper/centos-root 253:0 0 73.5G 0 lvm / ├─/dev/mapper/centos-swap 253:1 0 16G 0 lvm └─/dev/mapper/centos-home 253:2 0 10G 0 lvm /home /dev/sdb 8:16 0 100G 0 disk ├─/dev/sdb1 8:17 0 18.6G 0 part ├─/dev/sdb2 8:18 0 18.6G 0 part └─/dev/sdb3 8:19 0 18.6G 0 part /dev/sr0 11:0 1 4.4G 0 rom # fdisk /dev/sdb WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Command (m for help): d Partition number (1-3, default 3): 3 Partition 3 is deleted
Command (m for help): d Partition number (1,2, default 2): 2 Partition 2 is deleted
Command (m for help): d Selected partition 1 Partition 1 is deleted
Command (m for help): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks. # lsblk -p NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT /dev/sda 8:0 0 100G 0 disk ├─/dev/sda1 8:1 0 500M 0 part /boot └─/dev/sda2 8:2 0 99.5G 0 part ├─/dev/mapper/centos-root 253:0 0 73.5G 0 lvm / ├─/dev/mapper/centos-swap 253:1 0 16G 0 lvm └─/dev/mapper/centos-home 253:2 0 10G 0 lvm /home /dev/sdb 8:16 0 100G 0 disk /dev/sr0 11:0 1 4.4G 0 rom
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]