wetopi / docker-volume-rbd

Docker Engine managed plugin to manage RBD volumes.
MIT License
69 stars 18 forks source link

encountered an issue with resizing the RBD disk. #27

Closed steven3579 closed 3 months ago

steven3579 commented 3 months ago

I used the Ceph interface to resize a volume from its default size of 1024MB to 5GB. However, on my Docker server, it still recognizes the size as 1024MB. I've tried various methods, but none have yielded results. Has anyone else encountered a similar situation?

I run command: docker run -it -v $(docker volume create -d rbd-volume -o size=1024 busybox_volume):/data --volume-driver=rbd-volume busybox Screenshot from 2024-05-16 10-08-57 Screenshot from 2024-05-16 10-10-48

sitamet commented 3 months ago

Not sure about ceph interface. Here a comand-line process:

# 1. inspect current size [optional]: 
rbd info ssd/busybox_volume

# 2. repair ext4:
rbd map ssd/busybox_volume
# /dev/rbd0
fsck.ext4 /dev/rbd0

# 3. inspect current content usage [optional]:
mkdir /mnt/joan
mount /dev/rbd0 /mnt/joan
df -h /mnt/joan
umount /mnt/joan
rmdir /mnt/joan

# 4. resize rbd volume. Sometimes the MMP gives an alert, follow the suggested command
rbd resize --size 160G ssd/busybox_volume

# 5. resize the ext4 fs:

# clean the MMP (multiple mount protection)
tune2fs -f -E clear_mmp /dev/rbd0
e2fsck -f /dev/rbd0
resize2fs /dev/rbd0

# 6. unmap the device:
rbd unmap ssd/busybox_volume
steven3579 commented 3 months ago

Not sure about ceph interface. Here a comand-line process:

# 1. inspect current size [optional]: 
rbd info ssd/busybox_volume

# 2. repair ext4:
rbd map ssd/busybox_volume
# /dev/rbd0
fsck.ext4 /dev/rbd0

# 3. inspect current content usage [optional]:
mkdir /mnt/joan
mount /dev/rbd0 /mnt/joan
df -h /mnt/joan
umount /mnt/joan
rmdir /mnt/joan

# 4. resize rbd volume. Sometimes the MMP gives an alert, follow the suggested command
rbd resize --size 160G ssd/busybox_volume

# 5. resize the ext4 fs:

# clean the MMP (multiple mount protection)
tune2fs -f -E clear_mmp /dev/rbd0
e2fsck -f /dev/rbd0
resize2fs /dev/rbd0

# 6. unmap the device:
rbd unmap ssd/busybox_volume

It's working. Thank you for your help.