Reducing a Digital Ocean volume in size

(Created page with "{{post |date=2020-02-04 00:19:00 +0000 |timezone=+8 |location=Fremantle |categories=system administration,Digital Ocean,volumes }} Reducing a Digital Ocean volume size: # C...")
(No difference)

Revision as of 00:36, 4 February 2020


Reducing a Digital Ocean volume size:

  1. Create new volume
  2. Mount it: sudo mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_data2 /mnt/data2
  3. Add entry to fstab: /dev/disk/by-id/scsi-0DO_Volume_data2 /mnt/data2 ext4 defaults,nofail,discard 0 0
  4. Copy everything from old to new with rsync -av /mnt/data/ /mnt/data2/ (note trailing slashes)

Unmount the old volume: sudo umount /mnt/data Edit fstab to remove the old volumn and change the new one's to /mnt/data Mount new to old place: sudo mount -o discard,defaults,noatime /dev/disk/by-id/scsi-0DO_Volume_data2 /mnt/data unmount: sudo umount /mnt/data2 sudo rmdir data2/

  1. Restart to make sure everything comes back up as it should (this isn't really a good way to do this, but I'm lazy and not many people use this server).
    • sudo shutdown -r now
Retrieved from ‘