You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will create a 4GB file in /path/to/git-data/testfile. It performs 4KB reads and writes using a 75%/25% split within the file, with 64 operations running at a time. Be sure to delete the file after the test completes.
Notice the iops values in this output. In this example, the SSD performed 33,415 read operations per second and 11,219 write operations per second. A spinning disk might yield 2,000 and 700 read and write operations per second.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 24G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 23G 0 part
├─rhel-root 253:0 0 20.6G 0 lvm /
└─rhel-swap 253:1 0 2.4G 0 lvm [SWAP]
sdb 8:16 0 4G 0 disk
sr0 11:0 1 1024M 0 rom
Disk Space Usage
Note: The -h flag tells the df command to print byte counts in "human readable" format, i.e. 1.2G vs. 1220172. The . (period) at the end of the command indicates that we're only interested in disk usage for the device that contains the current directory.
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 21G 915M 20G 5% /
View Partition Table
# fdisk -l
Disk /dev/sda: 25.8 GB, 25769803776 bytes, 50331648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000d932d
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 50331647 24116224 8e Linux LVM
Disk /dev/mapper/rhel-root: 22.1 GB, 22112370688 bytes, 43188224 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/rhel-swap: 2579 MB, 2579496960 bytes, 5038080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Create new Physical Volume (from raw disk)
The following commands create a new 2GB Physical Volume on a 4GB Physical Disk /dev/sdb.
# fdisk /dev/sdb
Command (m for help): <-- n
Command action
p primary (0 primary, 0 extended, 4 free)
e extended
<-- p
Partition number (1-4, default 1): <-- 1
First sector (2048-8388607, default 2048): <-- <ENTER>
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-8388607, default 8388607): <-- +2G
Partition 1 of type Linux and of size 2 GiB is set
Command (m for help): <-- t
Selected partition 1
Hex code (type L to list codes): <-- 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): <-- w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Adding Physical Volume to existing Volume Group (Extending VG)
The following command lists existing rhel Volume Group on /dev/sda2 Physical Volume.
Note: Use vgdisplay and pvdisplay to display more information.
Now the rootLogical Volume can be resized with using the available free space. The Physical Extend (PE) available for can be displayed using the vgdisplay command. (511 / < 2.00GB). The LV path (/dev/rhel/root) can be displayed using lvdisplay command.
# vgdisplay
--- Volume group ---
VG Name rhel
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 24.99 GiB
PE Size 4.00 MiB
Total PE 6398
Alloc PE / Size 5887 / <23.00 GiB
Free PE / Size 511 / <2.00 GiB
VG UUID hBrQOm-K28x-qMzo-HXGQ-uMzS-6pCc-xW8ALx
# lvextend -l +511 /dev/rhel/root
Size of logical volume rhel/root changed from 20.59 GiB (5272 extents) to <22.59 GiB (5783 extents).
Logical volume rhel/root successfully resized.
# xfs_growfs /dev/rhel/root
Note: After Extending, we need to re-size the file-system using xfs_growfs. For EXT filesystem, the command is resize2fs.
Now the lsblk and df -h . commands will show the following.
# df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 23G 916M 22G 4% /
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 24G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 23G 0 part
├─rhel-root 253:0 0 22.6G 0 lvm /
└─rhel-swap 253:1 0 2.4G 0 lvm [SWAP]
sdb 8:16 0 4G 0 disk
└─sdb1 8:17 0 2G 0 part
└─rhel-root 253:0 0 22.6G 0 lvm /