Posts

Showing posts from 2021

Attach disk volume in Azure on CentOS VM

  # lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd" sd a     2:0:0:0       30G   |- sd a1               1M   `- sd a2               30G / sd b     3:0:1:0       80G   `- sd b1               80G /mnt/resource sd c     5:0:0:0     512G   If you are attaching a new disk, you need to partition the disk: The parted utility can be used to partition and to format a data disk. The following example uses parted on /dev/sdc, which is where the first data disk will typically be on most VMs. Replace sdc with the correct option for your disk. We are also formatting it using the xfs filesystem. # parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100% # mkfs.xfs /dev/sdc # partprobe /dev/sdc The above partprobe command will make sure the kernel is aware of the new partition and filesystem. Failure to use partprobe can cause the blkid or lslbk commands to not return the UUID for the new filesystem immediately. Use mount to then mount the filesystem: # mkdir /datadrive # mount /dev

Find out the open ports in an instance

  Below command will list out ports which are already defined in the linux machine: $ semanage port -l | grep http_port_t http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t            tcp      5988 If you wish to add a new port to the list, run the below command: $ semanage port -l | grep http_port_t -p tcp 7001 http_port_t                    tcp      7001, 80, 81, 443, 488, 8008, 8009, 8443, 9000 pegasus_http_port_t            tcp      5988 Check if firewall rules are enabled: $ service iptables status Table: filter Chain INPUT (policy ACCEPT) num  target     prot opt source               destination 1    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 Chain FORWARD (policy ACCEPT) num  target     prot opt source               destination Chain OUTPUT (policy ACCEPT) num  target     prot opt source               destination If you wish