Welcome to TopTechSteps, Let's learn together

Filesystem/Partition expansion using parted

Toggle Post Content Toggle Post Content

 Before expansion FS details

# lsblk

NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS

sda                                  8:0    0   450G  0 disk

├─sda1                          8:1    0     1G  0 part /boot

├─sda2                          8:2    0   500M  0 part /boot/efi

└─sda3                           8:3    0  440.9G  0 part

  ├─vg_root-lv_lv1       254:0    0    16G  0 lvm  [SWAP]

  ├─vg_root-lv_lv2       254:1    0    40G  0 lvm  /

  ├─vg_root-lv_lv3       254:2    0    15G  0 lvm  /lv3

  ├─vg_root-lv_lv4       254:3    0   317G  0 lvm  /lv4

  └─vg_root-lv_lv5       254:4    0    50G  0 lvm  /lv5

sr0                       11:0    1  1024M  0 rom                  


After expanding disk from VM , run below command to expand in OS

# echo + >> /sys/block/sda/device/rescan


After expansion FS details

# lsblk

NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS

sda                                  8:0    0   700G  0 disk

├─sda1                           8:1    0     1G  0 part /boot

├─sda2                           8:2    0   500M  0 part /boot/efi

└─sda3                            8:3    0 440.9G  0 part

  ├─vg_root-lv_lv1       254:0    0    16G  0 lvm  [SWAP]

  ├─vg_root-lv_lv2       254:1    0    40G  0 lvm  /

  ├─vg_root-lv_lv3       254:2    0    15G  0 lvm  /lv3

  ├─vg_root-lv_lv4       254:3    0   317G  0 lvm  /lv4

  └─vg_root-lv_lv5       254:4    0    50G  0 lvm  /lv5

sr0                                  11:0    1  1024M  0 rom


 Stesp to expand FS using parted

# parted /dev/sda

GNU Parted 3.2

Using /dev/sda

Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) resizepart

Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 524288000 blocks) or continue with the

current setting?

Fix/Ignore? Fix

Partition number? 3

End?  [475GB]? 700000 --- size in MB

(parted) print

Model: VMware Virtual disk (scsi)

Disk /dev/sda: 752GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Disk Flags:

Number  Start   End     Size    File system  Name  Flags

 1      1049kB  1075MB  1074MB  xfs

 2      1075MB  1599MB  524MB   fat16              msftdata

 3      1599MB  700GB   698GB                      lvm

(parted) q


Information: You may need to update /etc/fstab.


PV resize to add free space to VG


# pvresize /dev/sda3


  Physical volume "/dev/sda3" changed


  1 physical volume(s) resized or updated / 0 physical volume(s) not resized


# vgs


  VG      #PV #LV #SN Attr   VSize   VFree


  vg_root   1   5   0 wz--n- 650.43g 212.43g


# lsblk


NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS

sda                                   8:0    0   700G  0 disk

├─sda1                            8:1    0     1G  0 part /boot

├─sda2                            8:2    0   500M  0 part /boot/efi

└─sda3                             8:3    0 650.4G  0 part

  ├─vg_root-lv_lv1       254:0    0    16G  0 lvm  [SWAP]

  ├─vg_root-lv_lv2       254:1    0    40G  0 lvm  /

  ├─vg_root-lv_lv3       254:2    0    15G  0 lvm  /lv3

  ├─vg_root-lv_lv4       254:3    0   317G  0 lvm  /lv4

  └─vg_root-lv_lv5       254:4    0    50G  0 lvm  /lv5

sr0                                   11:0    1  1024M  0 rom


LV expansion:

# lvextend -L +150G /dev/mapper/vg_root-lv_lv5

  Size of logical volume vg_root/lv_lv5 changed from 317.00 GiB (81152 extents) to 467.00 GiB (119552 extents).


  Logical volume vg_root/lv_lv5 successfully resized.

# xfs_growfs /dev/mapper/vg_root-lv_lv5

meta-data=/dev/mapper/vg_root-lv_lv5 isize=512    agcount=6, agsize=16384000 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=1        finobt=1, sparse=1, rmapbt=0

         =                       reflink=0    bigtime=0 inobtcount=0

data     =                       bsize=4096   blocks=83099648, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0, ftype=1

log      =internal log           bsize=4096   blocks=32000, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =none                   extsz=4096   blocks=0, rtextents=0

data blocks changed from 83099648 to 122421248


After expansion FS details

# df -hT /lv5

Filesystem                               Type      Size  Used Avail Use% Mounted on

/dev/mapper/vg_root-lv_lv5 xfs       467G  311G  157G  67% /lv5

Connectivity issues due to proxy in SUSE Linux

Toggle Post Content

server:~ # curl -Sks https://client.com/pub/test.sh | /bin/bash

curl: (56) Received HTTP code 407 from proxy after CONNECT

Below are the proxy details enabled in server

server:~ # env |grep -i prox

https_proxy=http://proxy:8080

http_proxy=http://proxy:8080


Remove/Disable proxy

Temporary change

server:~ # export https_proxy=""

server:~ # export http_proxy=""

Permanent change

update above entries in /etc/sysconfig/proxy file


server:~ # curl -Sks https://client.com/pub/test.sh | /bin/bash

curl: (56) Received HTTP code 407 from proxy after CONNECT

Test failed 😢

server:~ # cat /root/.curlrc

# Changed by YaST2 module proxy 03/09/20

--proxy "http://proxy:8080"

--noproxy "localhost,127.0.0.1,10.0.0.0/8"


commented "--proxy "http://proxy:8080"" in /root/.curlrc

Restart session to reflect the changes

Now try

server:~ # curl -Sks https://client.com/pub/test.sh | /bin/bash

Working 👍


Other way to disable proxy by adding client.com as an exception in the no proxy entry

no_proxy=localhost,127.0.0.1,10.0.0.0/8,client.com


and also update the no proxy entry in /root/.curlrc

--noproxy "localhost,127.0.0.1,10.0.0.0/8,client.com"

Remove LUN from multipath

Toggle Post Content Toggle Post Content

 List out FileSystems

 #df -hTP

Unmount FileSystems 
 #umount partition

Remove LV, VG and PV from LVM
 #umount /dev/vg/lv

 #lvremove lv

 #vgremove vg

 #pvremove pv

List all multipath devices
 #multipath -ll

Flush multipath
 #multipath -f mpath9

Remove each path to the multipath device from the SCSI subsystem
 #echo 1 > /sys/block/sd/device/delete (sda or sdb or ...)

 After doing this we can't see disk in fdisk / lsblk output.

Remove/Detach disk from System

Ad space

Responsive Advertisement

I am here to help you...

View count