Archive for November, 2021

1. fdisk /dev/sda
p
q

2. Extend the VMDK in vCenter

3. fdisk /dev/sda
p
q

4. If no extra space:
echo ‘1’ > /sys/class/scsi_disk/0\:0\:0\:0/device/rescan

5. fdisk /dev/sda
p
q
There is free space

6. Delete partition
d
4
n
p
4
<enter>
<enter>
t
4
8e

p
w -> write partition!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

7. partprobe -s

8. Extend
pvresize /dev/sda4
vgdisplay
lvdisplay
df -h
lvextend -L +100%FREE /dev/VGroot/LV01
lvdisplay
df -h
resize2fs /dev/VGroot/LV01 or fsadm resize /dev/VGroot/LV01
df -h


============ CHECK ================

# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/sda3         24G         7,4G   16G           33% /
/dev/sda2        512M         7,8M  505M            2% /boot/efi

# fdisk -l


======= increase disk size / VMWARE / HYPER-V ========


============ CHECK ================
# fdisk -l


====== look at partition ============
# fdisk /dev/sda

Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p



========== delete partition =============

Command (m for help): d
Partition number (1-3, default 3): 3

Partition 3 has been deleted.



========== create partition =============

Command (m for help): n
Partition number (3-128, default 3):3
enter
enter

Partition #3 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: N
Command (m for help): w


=================== reboot ================

reboot



================= extend partition ===============
# resize2fs /dev/sda3