Menginstall utilitas gdisk
[root@tanya ~]# yum install gdisk Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package gdisk.x86_64 0:0.8.10-3.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Installing: gdisk x86_64 0.8.10-3.el7 base 190 k Transaction Summary =============================================================================================================================================================================================== Install 1 Package Total download size: 190 k Installed size: 660 k Is this ok [y/d/N]: y Downloading packages: warning: /var/cache/yum/x86_64/7/base/packages/gdisk-0.8.10-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY ] 0.0 B/s | 111 kB --:--:-- ETA Public key for gdisk-0.8.10-3.el7.x86_64.rpm is not installed gdisk-0.8.10-3.el7.x86_64.rpm | 190 kB 00:00:01 Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Importing GPG key 0xF4A80EB5: Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected]>" Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5 Package : centos-release-7-9.2009.0.el7.centos.x86_64 (@anaconda) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 Is this ok [y/N]: y Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : gdisk-0.8.10-3.el7.x86_64 1/1 Verifying : gdisk-0.8.10-3.el7.x86_64 1/1 Installed: gdisk.x86_64 0:0.8.10-3.el7 Complete! [root@tanya ~]#
[root@tanya ~]# gdisk /dev/sdb GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): p Disk /dev/sdb: 1048576000 sectors, 500.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 4EFAECDB-0F01-4CC0-8497-D18CC7F34C32 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1048575966 Partitions will be aligned on 2048-sector boundaries Total free space is 1048575933 sectors (500.0 GiB) Number Start (sector) End (sector) Size Code Name Command (? for help): n Partition number (1-128, default 1): First sector (34-1048575966, default = 2048) or {+-}size{KMGTP}: Last sector (2048-1048575966, default = 1048575966) or {+-}size{KMGTP}: Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): L 0700 Microsoft basic data 0c01 Microsoft reserved 2700 Windows RE 3000 ONIE boot 3001 ONIE config 4100 PowerPC PReP boot 4200 Windows LDM data 4201 Windows LDM metadata 7501 IBM GPFS 7f00 ChromeOS kernel 7f01 ChromeOS root 7f02 ChromeOS reserved 8200 Linux swap 8300 Linux filesystem 8301 Linux reserved 8302 Linux /home 8400 Intel Rapid Start 8e00 Linux LVM a500 FreeBSD disklabel a501 FreeBSD boot a502 FreeBSD swap a503 FreeBSD UFS a504 FreeBSD ZFS a505 FreeBSD Vinum/RAID a580 Midnight BSD data a581 Midnight BSD boot a582 Midnight BSD swap a583 Midnight BSD UFS a584 Midnight BSD ZFS a585 Midnight BSD Vinum a800 Apple UFS a901 NetBSD swap a902 NetBSD FFS a903 NetBSD LFS a904 NetBSD concatenated a905 NetBSD encrypted a906 NetBSD RAID ab00 Apple boot af00 Apple HFS/HFS+ af01 Apple RAID af02 Apple RAID offline af03 Apple label af04 AppleTV recovery af05 Apple Core Storage be00 Solaris boot bf00 Solaris root bf01 Solaris /usr & Mac Z bf02 Solaris swap bf03 Solaris backup bf04 Solaris /var bf05 Solaris /home bf06 Solaris alternate se bf07 Solaris Reserved 1 bf08 Solaris Reserved 2 bf09 Solaris Reserved 3 bf0a Solaris Reserved 4 bf0b Solaris Reserved 5 c001 HP-UX data c002 HP-UX service ea00 Freedesktop $BOOT eb00 Haiku BFS ed00 Sony system partitio ed01 Lenovo system partit Press the <Enter> key to see more codes: 8300 ef00 EFI System ef01 MBR partition scheme ef02 BIOS boot partition fb00 VMWare VMFS fb01 VMWare reserved fc00 VMWare kcore crash p fd00 Linux RAID Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem' Command (? for help): p Disk /dev/sdb: 1048576000 sectors, 500.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 4EFAECDB-0F01-4CC0-8497-D18CC7F34C32 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 1048575966 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB) Number Start (sector) End (sector) Size Code Name 1 2048 1048575966 500.0 GiB 8300 Linux filesystem Command (? for help): wq Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sdb. The operation has completed successfully. [root@ASK ~]# [root@ASK ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 49G 0 part ├─centos-root 253:0 0 44G 0 lvm / └─centos-swap 253:1 0 5G 0 lvm [SWAP] sdb 8:16 0 500G 0 disk └─sdb1 8:17 0 500G 0 part sdc 8:32 0 300G 0 disk sr0 11:0 1 4.4G 0 rom [root@tanya ~]#
[root@tanya ~]# gdisk /dev/sdc GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): p Disk /dev/sdc: 629145600 sectors, 300.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 179380C5-ED63-40F2-A0EC-294A8379E3A3 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 629145566 Partitions will be aligned on 2048-sector boundaries Total free space is 629145533 sectors (300.0 GiB) Number Start (sector) End (sector) Size Code Name Command (? for help): n Partition number (1-128, default 1): First sector (34-629145566, default = 2048) or {+-}size{KMGTP}: Last sector (2048-629145566, default = 629145566) or {+-}size{KMGTP}: Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem' Command (? for help): p Disk /dev/sdc: 629145600 sectors, 300.0 GiB Logical sector size: 512 bytes Disk identifier (GUID): 179380C5-ED63-40F2-A0EC-294A8379E3A3 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 629145566 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB) Number Start (sector) End (sector) Size Code Name 1 2048 629145566 300.0 GiB 8300 Linux filesystem Command (? for help): wq Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sdc. The operation has completed successfully. [root@ASK ~]# [root@ASK ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 50G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 49G 0 part ├─centos-root 253:0 0 44G 0 lvm / └─centos-swap 253:1 0 5G 0 lvm [SWAP] sdb 8:16 0 500G 0 disk └─sdb1 8:17 0 500G 0 part sdc 8:32 0 300G 0 disk └─sdc1 8:33 0 300G 0 part sr0 11:0 1 4.4G 0 rom [root@tanya ~]# [root@tanya ~]# vgcreate datavg /dev/sdb1 /dev/sdc1 Physical volume "/dev/sdb1" successfully created. Physical volume "/dev/sdc1" successfully created. Volume group "datavg" successfully created [root@tanya ~]# [root@tanya ~]# vgs VG #PV #LV #SN Attr VSize VFree centos 1 2 0 wz--n- <49.00g 0 datavg 2 0 0 wz--n- 799.99g 799.99g [root@tanya ~]# [root@tanya ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 centos lvm2 a-- <49.00g 0 /dev/sdb1 datavg lvm2 a-- <500.00g <500.00g /dev/sdc1 datavg lvm2 a-- <300.00g <300.00g [root@tanya ~]# [root@tanya ~]# lvcreate -l 100%FREE -n datalv datavg Logical volume "datalv" created. [root@tanya ~]# [root@tanya ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root centos -wi-ao---- <44.00g swap centos -wi-ao---- 5.00g datalv datavg -wi-a----- 799.99g [root@tanya ~]# [root@tanya ~]# mkfs.xfs /dev/mapper/datavg-datalv Discarding blocks...Done. meta-data=/dev/mapper/datavg-datalv isize=512 agcount=4, agsize=52428288 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=209713152, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=102399, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@tanya ~]# [root@tanya ~]# mkdir /data [root@tanya ~]# [root@tanya ~]# mount /dev/mapper/datavg-datalv /data [root@tanya ~]# [root@tanya ~]# echo "/dev/mapper/datavg-datalv /data xfs defaults 0 0" >> /etc/fstab [root@tanya ~]# [root@tanya ~]# cat /etc/fstab # # /etc/fstab # Created by anaconda on Tue Aug 13 16:30:04 2024 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/centos-root / xfs defaults 0 0 UUID=4f8233c7-66d8-4837-83b2-440f5bf7ceff /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 /dev/mapper/datavg-datalv /data xfs defaults 0 0 [root@tanya ~]# [root@tanya ~]# df -hT Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 3.9G 8.6M 3.9G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mapper/centos-root xfs 44G 1.8G 43G 4% / /dev/sda1 xfs 1014M 150M 865M 15% /boot tmpfs tmpfs 783M 0 783M 0% /run/user/0 /dev/mapper/datavg-datalv xfs 800G 33M 800G 1% /data [root@tanya ~]#
Pengujian fstab
[root@tanya ~]# umount -l /data [root@tanya ~]# [root@tanya ~]# mount -a [root@tanya ~]# [root@tanya ~]# df -hT Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 3.9G 8.6M 3.9G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mapper/centos-root xfs 44G 1.8G 43G 4% / /dev/sda1 xfs 1014M 150M 865M 15% /boot tmpfs tmpfs 783M 0 783M 0% /run/user/0 /dev/mapper/datavg-datalv xfs 800G 33M 800G 1% /data [root@tanya ~]#