Skip to main content

Posts

Showing posts from November, 2022

Extend Logical Volume (LV) Size in Linux

Overview The Logical Volume Manager (LVM) provides tools to create virtual block devices from physical devices. Virtual devices may be easier to manage than physical devices and can have capabilities beyond what the physical devices provide themselves. A Volume Group (VG) is a collection of one or more physical devices, each called a Physical Volume (PV). A Logical Volume (LV) is a virtual block device that can be used by the system or applications. Each block of data in an LV is stored on one or more PV in the VG, according to algorithms implemented by Device Mapper (DM) in the kernel. – man page. 1. Check the details about mount point 1.1. Check the mount point, [root@hostname ~]# df -h /dev/mapper/vg_u01–lv_u01 256G 9.2G 247G 4% /u01 I want to increase the size of /u01 to 3.5TB. This directory relies on the vg_u01 volume group and lv_u01 logical volume. 1.2. So, Need to check the logical volume of this mount point, [root@hostname ~]# lvs lv_u01 vg_u01 -wi-ao—- <256.00g 1.3.

Remove Unused Logical Volume(lvm) from Linux

1. Un-mount the desired lvm mount point: [root@hostname ~]# umount /mount_point i.e. [root@hostname ~]# umount /u02 Here /u02 is the unwanted mount point that will no longer be needed in my case. 2. Remove the mount point entry from /etc/fstab file: [root@hostname ~]# vim /etc/fstab UUID=bbc37d9d-f553-486b-81e9-c2cae03e434a /u02 xfs defaults 0 0 In my case, I need to remove the above line. 3. Remove the associated Logical volume: 3.1. See the list of Logical volume , [root@hostname ~]# lvdisplay or [root@hostname ~]# lvs 3.2. Now, remove the right Logical volume , [root@hostname ~]# lvremove /dev/vg_name/lv_name i.e. [root@hostname ~]# lvremove /dev/vg_u02/lv_u02 4. Now, remove the associated Volume group: 4.1. See the list of Volume group , [root@hostname ~]# vgdisplay or [root@hostname ~]# vgs 4.2 Now, remove the right Volume group , [root@hostname ~]# vgremove vg_name i.e. [root@hostname ~]# vgremove vg_u02 5. Now, remove the associated Physical volume: 5.1. See the list of Physica

How to Change the RDP port in the Windows server/Desktop

To add a new RDP Port to the registry: Open PowerShell with Administrator mode and run the below command to change your default RDP Port from 3389 to 9999. PS C:\Windows\system32> $portvalue = 9999PS C:\Windows\system32> Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue Allow to Firewall: To Add this non-default firewall policy run the below command, PS C:\Windows\system32> New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvaluePS C:\Windows\system32> New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue or, PS C:\Windows\system32> New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -Lo