Here is a snippet of my notes for reducing drbd disk size (assuming that the physical device is on LVM which can be resized).
Just remember that a drbd device is a container, and HAS METADATA. Therefore think about it as a filesystem. Also, this procedure will only work if the disks are ONLINE (the disks are attached, and drbd is running).
In this example, A filesystem has only 100 megs worth of data; we want to shrink the physical store down from 500 to about 120 Megs.
WARNING: This procedure can be destructive is done wrong.
1. Note the filesytem consumed size. For this example the filesystem contains 100M worth fo data. Shrink the filesystem. Note that -M resizes to minimum size.
umount /dev/drbd0
fsck -f /dev/drbd0
resize2fs -M /dev/drbd0
At this point the filesytem on /dev/drbd0 should be at the minimum (i.e., close to the consumed size---about 100 MB in this example). If you are not sure, mount the fileystem again and use "df" or use tune2fs (if ext4) to MAKE SURE.
2. Resize the drbd device. Make sure it is higher than the fileystem size because drbd also uses disk space for metadata!
drbdadm -- --size=110M resize r0
If you would type in "lsblk" at this point, drbd0 should show about 110M.
3. Shrink the physical backing device to a bit higher than the drbd device:
on first node (drb7): lvresize -L 120M /dev/drt7/disk1
on first node (drb8): lvresize -L 120M /dev/drt8/disk1
4. Size up the drbd device to use up all available LV space:
drbdadm resize r0
4. Finally size up the filesystem:
resize2fs /dev/drbd0
5. Mount and verify that the filesystem is indeed 120 Megs.
Subscribe to:
Post Comments (Atom)
Creating ipip tunnels in RedHat 8 that is compatible with LVS/TUN. Every few seasons I built a virtual LVS (Linux Virtual Server) mock up ju...
-
Occasionally we are troubled by failure alerts; since I have installed the check_crm nagios monitor plugin the alert seems more 'sensiti...
-
This is how to set up a dummy interface on RedHat/CentOS 8.x. I cannot make the old style of init scripts in /etc/sysconfig/network-scripts...
-
While testing pacemaker clustering with iscsi (on redhat 8 beta) I came upon this error: Pending Fencing Actions: * unfencing of rh-8beta...
No comments:
Post a Comment