Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#4428 closed defect (fixed)

debbie-docker move to new disk

Reported by: robe Owned by: robe
Priority: medium Milestone: Website Management, Bots
Component: management Version: master
Keywords: Cc:

Description (last modified by robe)

We have a lot of fat docker images for postgis, geos, geos-php which was eating up a lot of space so was down to 4 GB on the partition I had alotted for lxd zfs.

That said I created a new 250GB disk zfs partition and moved debbie docker to that.

I'll write the steps in

https://git.osgeo.org/gitea/postgis/postgis-servers

once I've figured the best place to put it, for now here are my scribbled notes:

Change History (2)

comment:1 by robe, 6 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

My scribbled notes


Attach to host.postgis.net 
https://www.atlantic.net/community/howto/configuring-block-storage-linux-servers/

#Go back into to server 
ls /dev/disk/by-id/scsi-0AN_Volume_*

should output -  /dev/disk/by-id/scsi-0AN_Volume_postgis_storage

#now install gdisk to help setting up 
apt install gdisk
gdisk /dev/disk/by-id/scsi-0AN_Volume_postgis_storage

Command (? or help):  n  #this will create a new partition taking up whole drive
take remaining defualts by clicking enter

When hit the next:
Command (? or help): p  #this will print the disk layout

When hit the next:
Command (? or help): w  #saves the partition

Y to confirm

#now add new pool to existing lxd

#upgrade to larger disk
http://genetics.wustl.edu/technology/replacing-a-bad-zfs-drive-with-larger-drive/

#create on existing zfs and add to lxd
zpool create -f lxd2 /dev/disk/by-id/scsi-0AN_Volume_postgis_storage

lxc storage create pool2 zfs source=lxd2

#move containers to new pool
https://blog.bilak.info/2018/07/08/moving-lxd-containers-from-one-pool-to-another/

#move debbie-docker to new pool
lxc exec debbie-docker bash
#in debbie-docker
shutdown -P -H now

lxc storage list #confirm in use
lxc cp debbie-docker debbie-docker-moved -s=pool2

#rename original container
lxc mv debbie-docker debbie-docker-to-delete

#move new back to old name and cofirm good by starting
# rename container back for sanity ;)
lxc mv debbie-docker-moved debbie-docker
lxc start debbie-docker

# rename container back for sanity ;)
lxc move some_container-moved some_container



# if you want to move instead do
# move container to pool2
```
lxc mv some-container some-container-moved -s=pool2
```

comment:2 by robe, 4 years ago

Milestone: Management 2.0Website Management, Bots

Milestone renamed

Note: See TracTickets for help on using tickets.