Received feedback today that some files failed to synchronize. Looking at the logs found:
rsync: recv_generator: mkdir "/app/data/ckl/ckli2780581" failed: Too many links (31) *** Skipping any contents from this failed directory ***
- enter the relevant directory to establish file:
cd /app/data/ckl/ mkdir vd
Report the same error:
failed: Too many links
2. Check the directory
ls /app/data/ckl | wc -l 31998
The sheer number of directories may be a limitation of the file system
3. Check the file system
df -lhT Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 ext3 7.9G 4.9G 2.7G 65% /
It was ext3
is roughly as follows:
nclude/linux/ext2_fs.h:#define EXT2_LINK_MAX 32000 include/linux/ext3_fs.h:#define EXT3_LINK_MAX 32000
Why 31,998?This is because when mkdir creates a directory, two subdirectories are created by default, one is. The directory (representing the current directory), and the other one is.. Directory (representing the parent directory). These two subdirectories are not deleted, “rm.” will get “RM: cannot remove ‘.’ or ‘.. ‘”. So 32000-2 = 31998.
Solution:
Ext4 has no limit on the number of directories
Mount a new disk to establish a connection to the directory
The script is as follows:
#!/bin/bash CUR_DAY=`date +%Y%m%d` SRC_DIR=/app DST_DIR=/data fdisk /dev/vdc <<EOF d n p 1 1 t 83 w EOF echo echo "star create vg and lv..." pvcreate /dev/sdc1 if [ $? -eq 0 ];then vgcreate data-volume /dev/vdc1 if [ $? -eq 0 ];then lvcreate -L 99G -n s1_data data-volume else echo "lv create failed!" exit 1 else echo "vg create failed !" fi mkfs -t ext4 /dev/data-volume/s1_data mount /dev/data-volume/s1_data ${DST_DIR} cp -a ${SRC_DIR}/data ${DST_DIR} mv ${SRC_DIR}/data ${SRC_DIR}/data_bak/ ln -s ${DST_DIR}/data/ ${SRC_DIR}/data
Read More:
- Solve the problem of Too many levels of symbolic links
- Android resource compilation failed (How to Fix)
- express nodejs Failed to lookup view error in views directory (How to Fix)
- INSTALL PARSE FAILED INCONSISTENT CERTIFICATES (How to Fix)
- Android Studio: Application Installation Failed (How to Fix)
- How to Fix Spring Boot OTS parsing error: Failed to convert WOFF 2.0
- How to Fix Tomcat Error: Failed to destroy end point associated with ProtocolHandler[ajp-nio-8009]
- How to Fix ubuntu phpmyadmin error: “Connection for controluser as defined in your configuration failed”
- How to Fix Error137 (net::ERR_NAME_RESOLUTION_FAILED)
- ERROR: Failed to parse POMs (How to Fix)
- How to Fix Session is not Connecting (How to Diagnose it)
- How to Fix Failed to add the host to the list of known hosts
- How to Fix VMware Taking ownership of this virtual machine failed
- Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded (How to Fix)
- How to Fix failed to Connect to MySQL at localhost:3306 with user root
- Error c2375: “wsacleanup”: redefine; Different links, etc
- Uncaught TypeError: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node How to Fix
- Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory (How to Fix)
- Module build failed Error Plugin/Preset files are not allowed to export objects, only functions (How to Fix)
- How to Fix:java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpPost