Posts

Showing posts from 2022

How to resize and extend centos 7 disk manually

 How to resize and extend centos 7 disk manually Resizing The Partition You need to modify the   Linux   partition table within the   virtual machine   to recognize that the disk size has changed. This can be done using the   fdisk   utility, which is a partition editor. For the   virtual machine   provided by Nagios Enterprises: sda1   is used for the   boot   partition sda2   is the device for all logical volumes, this is the partition you need to edit Start   fdisk   by executing the following command: fdisk /dev/sda   You should print the current partition table so you can keep track of your changes as you go: Command (m for help): p Take a screenshot or copy the screen contents into a text file in case you want to reference it later. To resize a partition, you actually "delete" it and then add a new one with the new size, making sure to place the beginning of the new partition at the same sector/cylinder as the old one started. This process is NOT destructive, your data

Use Space from Extended Physical (or Virtual) Disk

Image
  Use Space from Extended Physical (or Virtual) Disk First you need to increase the size of the disk being presented to the Linux OS. This is most likely done by expanding the virtual disk in KVM/VMWare/Hyper-V or by adjusting your RAID controller / storage system to increase the volume size. You can often do this while Linux is running; without shutting down or restarting. I’ve extended my  100GB  disk to  200GB  for my example machine. Once that is done, you may need to get Linux to rescan the disk for the new free space. Check for free space by running  cfdisk  and see if there is free space listed, use “q” to exit once you’re done. If you don’t see free space listed, then initiate a rescan of  /dev/sda   with  echo 1>/sys/class/block/sda/device/rescan . Once done, rerun  cfdisk  and you should see the free space listed. Select your  /dev/sda3  partition from the list and then select “ Resize ” from the bottom menu. Hit  ENTER  and it will prompt you to confirm the new size. Hit 

Extend free space on ubuntu 20.04 disk

Extend free space on ubuntu 20.04 disk I also used the default Ubuntu 20.04 install from ISO w/ lvm option selected. I had the same problem with the OS disk not occupying what I had allocated.   Step as below: user@util:~ # sudo vgdisplay <snip> user@util:~ # sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv <snip> user@util:~ # sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv <snip> Before user@util:~ # sudo df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 795M 1.1M 793M 1% /run /dev/mapper/ubuntu--vg-ubuntu--lv 98G 6.5G 86G 8% / tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/xvda2 976M 105M 805M 12% /boot /dev/loop2
How to secure your SSH.   1. Permanently stop and disable ssh services (ubuntu) command: sudo systemctl stop ssh                 sudo systemctl disable ssh                 sudo systemctl status ssh To check if ports 22 still open after disable ssh command : sudo lsof -i:22 * Please run this command from server terminal in nutanix web reference -:  https://www.cyberciti.biz/ faq/howto-start-stop-ssh- server/   2. Reject all IP & accept ssh connection only by allow IP Address reference-:  https://docs. rackspace.com/support/how-to/ restrict-ssh-login-to-a- specific-ip-or-host/ 3. Using knockd filter ssh connection by knock port reference-:  https://www. linuxbabe.com/security/secure- ssh-service-port-knocking- debian-ubuntu 4. Using passwordless SSH login reference-:  https://www. linuxbabe.com/linux-server/ setup-passwordless-ssh-login