Linux Programmer | RHCE | RHCSA

Search This Blog

Showing posts with label aws. Show all posts
Showing posts with label aws. Show all posts

Wednesday, 25 January 2023

Convert MBR to GPT in AWS

 First check partition type of existing disk.

 parted -l




 

To convert MBR to GPT, create one partition with gpt and that will convert entire disk from msdos to gpt.

gdisk /dev/nvme0n1

■ n (i.e. new partition)
■ Enter (i.e Partition number : 2-128, default 2)
■ Enter (i.e. First sector : default = 34)
■ Enter (i.e. Last sector : default = 2047)
■ ef02 (i.e. Type of partition: BIOS boot partition)
■ w (i.e. Write the new partition table)
■ Y (i.e. Complete process)


Reload the partition table 


partprobe /dev/nvme0n1  

Re-install the GRUB boot loader using the new partition scheme 


grub-install /dev/nvme0n1
 

Increasing EBS volume 


growpart /dev/nvme0n1 1
resize2fs /dev/nvme0n1p1

Now Re-check the partition table created properly or not.

parted -l



Restrict SSH and Allow with SFTP

Create SFTP user:  ``` sudo useradd -M -s /sbin/nologin sftpuser sudo passwd sftpuser ``` Add below lines into, /etc/ssh/sshd_config ``` Mat...