Friday, August 10, 2018

Live resize Linux partition.


If disk has two partitions and we extended the disk to get more free space we can extend partition to use free space.

1. Use growpart

Test run if partition can be extended

sudo growpart -N /dev/vda 2 && echo $?

Actual extending partition

sudo growpart /dev/vda 2 && echo $?
In Debian and Ubuntu it is packaged as cloud-guest-utils.

2. Use parted, resizepart

sudo parted resizepart 2 -1

3. fdisk for advanced users
Use fdisk to delete partition and create new one to the end of disk.

Tuesday, August 7, 2018

How to Import a Git Repository from bundle backup


git clone --mirror test.bundle

cd test

git remote rm origin

git remote add origin https://git.mydomain.com/test/test.git

git push -u origin master