Top Nav

Archive | Linux

Mounting cloned disk

If you try to mount a cloned disk then you may get an error about duplicate UUID values. You can override with the “nouuid” option:

If the disk is using LVM then additional steps will be required:

Now you can list the partitions with lsblk and mount the desired logical volume with the “nouuid” option.

 

 

0

Yum 404 Error On Xen-46

On CentOS 7, getting 404 error from yum when trying to update.

The error is related to Xen-46 which has been removed. The fix is to remove the repo and add the new Xen-48 repo:

 

 

0

Partition Large Drive

The classic “fdisk” utility can’t create partitions larger then 2TB. The “parted” utility can be used instead as follows:

 

0

AWS Resize Partition

After expanding the size of an EBS volume on an AWS EC2 instance, you’ll need to expand the partition and the filesystem. Here are the steps:

  1. Confirm available storage with “lsblk” command.
  2. Expand the partition with “growpart” command like “growpart /dev/xvdi 1”. Of course you’ll need to change the device name to match your system. The partition number on the end will be “1” if there is only one partition on the device or can be changed to select a different partition. “growpart” is in the “cloud-guest-utils” package if it’s now already installed. Note that if you have a large  (> 2TB) partition) created with parted then “growpart” may not work. Instead use the “resize” command in “parted”.
  3. Confirm new partition size with “lsblk” command.
  4. If using LVM then expand the physical and logical volumes:
    1. Reread partitions with “partprobe”
    2. Resize physical volume with “pvresize /dev/xvdi1”
    3. Expand logical volume with “lvextend -l +100%FREE /dev/vg_data2/lv_data2”
  5. Resize the filesystem to fill the expanded partition. Command will depend on the filesystem type:
    • ext2/3/4 – “resize2fs /dev/xvdi1”
    • xfs – “xfs_growfs /dev/vg_data2/lv_data2”

Now you should have the expanded storage available for use.

Here’s the man pages for these commands:

https://www.systutorials.com/docs/linux/man/8-lsblk/

https://www.systutorials.com/docs/linux/man/1-growpart/

https://linux.die.net/man/8/resize2fs

https://linux.die.net/man/8/partprobe

https://www.systutorials.com/docs/linux/man/8-pvresize/

https://www.systutorials.com/docs/linux/man/8-lvextend/

https://www.systutorials.com/docs/linux/man/8-xfs_growfs/

 

0