#2088
[How-To] CentOS & RHEL
Create a new PV / VG / LV from an empty disk
# To retrieve the drive name lsblk
Create partition with fdisk
fdisk /dev/sdX p # print partition table n # create new partition p # type = primary partition ENTER # partition number (default or a value) ENTER # default - start at beginning of disk ENTER # 100 MB boot partiton t # change partition's type 8e # type : Linux LVM w # write changes
Create PV / VG / LV
# Create PV pvcreate /dev/sdX1 vgcreate vg_NAME /dev/sdX1 lvcreate -n lv_NAME -l 100%FREE vg_NAME mkfs -t ext4 /dev/vg_NAME/lv_NAME # -t disk type (ext4, xfs, etc)
Edit /etc/fstab & mount drive:
/dev/mapper/vg_NAME-lv_NAME /MOUNT_POUNT ext4 defaults 0 0 mkdir /MOUNT_POUNT # create mount point mount -a # mount fstab content
———-
Extend an existing partition by adding a new disk
Create a new PV / VG / LV from an empty disk
# To retrieve the drive name lsblk
Create partition with fdisk
fdisk /dev/sdX p # print partition table n # create new partition p # type = primary partition ENTER # partition number (default or a value) ENTER # default - start at beginning of disk ENTER # 100 MB boot partiton t # change partition's type 8e # type : Linux LVM w # write changes
Create PV / VG / LV
# Create PV pvcreate /dev/sdX1 #Retrieve the VG to extend with : vgdisplay # Extend VG vgextend vg_NAME /dev/sdX1 # With the utility pvscan you can see what physical volumes are available, and how much free space there is within them pvscan # Extend LV lvextend /dev/vg_NAME/lv_NAME /dev/sdX1 # Resize disk xfs_growfs /dev/vg_NAME/lv_NAME or resize2fs /dev/vg_NAME/lv_NAME # Check result lsblk df -h
S-Square Systems | Upgrade Opatch to 13.9.4.0.0 [How-To] SSH
CentOS 7 > Disable GUI :
CentOS 7 > Enable GUI :
CentOS 7 > Test if GUI is enabled :
(see also /etc/inittab)
Enable optional and extras repo :
Zip a file or a folder
Compress a folder using TAR :
To preserve permissions : –preserve-permissions (-p)
The – with czf is optional.
List route :
Add route :
See also : https://www.cyberciti.biz/faq/ip-route-add-network-command-for-linux-explained/
https://linoxide.com/how-tos/howto-permanently-add-static-route-in-linux/
Add color to motd :
Install OpenVPN (client)
Install netstat :
Truncate file :
Install python3 on RHEL 7.x:
https://developers.redhat.com/blog/2018/08/13/install-python3-rhel#tl_dr
see output of unattached process :
(tail is not working properly)
Enable color in vi/vim in CentOS/RHEL:
edit /etc/profile.d/vim.sh and comment the line “[ -n “$ID” -a “$ID” -le 200 ]”
CentOS 7 > Install Python3:
Replace default python2 by python3
Install nslookup:
force unmount an NFS drive