Target: 10T of broken File (10k-500k) data requires a local area network to migrate from one storage to another
Solution: Using DRBD software to transfer the expansion plan
Tip: The main node 10T, standby node 20T, if the DRBD synchronization scheme, the standby node and the main node size after synchronization. The remaining 10T of the standby node is not visible and cannot be used.
Problem:
Master node, the standby node is 2.0G, the standby node is 2.0G (the actual should be 3G, only 2G can be seen through the df-h command)
[Root@nfs-server-01 teddylu]# Df-h|grep md0
/dev/drbd0 2.0G 3.0M 1.9G 1%/md0
[Root@nfs-server-02 teddylu]# Df-h|grep md0
/dev/md0 2.0G 3.0M 1.9G 1%/md0
[Root@nfs-server-02 teddylu]# fdisk-l|grep/dev/md0
disk/dev/md0:3205 MB, 3205496832 bytes
Reason:
Because DRBD is based on block replication, the size on the standby node is identical to the primary node.
Solve:
[Root@nfs-server-02 teddylu]# umount/md0/
[root@nfs-server-02 teddylu]# drbdadm down data
[Root@nfs-server-02 teddylu]# e2fsck-f/dev/md0
E2fsck 1.41.12 (17-may-2010)
Pass 1:checking inodes, blocks, and sizes
Pass 2:checking directory structure
Pass 3:checking Directory Connectivity
Pass 4:checking Reference counts
Pass 5:checking Group summary information
/dev/md0:21/130560 files (0.0% non-contiguous), 17164/521472 blocks
[Root@nfs-server-02 teddylu]# resize2fs/dev/md0
RESIZE2FS 1.41.12 (17-may-2010)
Resizing the filesystem on/dev/md0 to 782592 (4k) blocks.
The filesystem on/dev/md0 is now 782592 blocks long.
[Root@nfs-server-02 teddylu]# mount/dev/md0/md0/
[Root@nfs-server-02 teddylu]# Df-h
FileSystem Size Used Avail use% mounted on
/dev/sda2 7.8G 3.5G 3.9G 48%/
Tmpfs 242M 0 242M 0%/dev/shm
/DEV/SDA1 190M 49M 132M 28%/boot
/dev/md0 3.0G 3.0M 2.8G 1%/md0
At this point, the size of the standby node is displayed as a normal 3G.
Tips
E2fsck–check a Linux ext2/ext3/ext4 file system
-F Force Checking even if the file system seems clean.
RESIZE2FS–EXT2/EXT3/EXT4 File System Resizer
the resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used To enlarge or shrink a unmounted file system located on device.