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:
- The command Du – h — max depth = 1 in Linux
- Mount windows NTFS partition under Linux
- Linux common problems and Solutions
- /sbin/mount.vboxsf: mounting failed with the error: No such device
- Introduction of Hadoop HDFS and the use of basic client commands
- Error installing network file system: Mount error 20 = not a directory
- Common problems and solutions under Linux
- Sina world of Warcraft 3.1.3 compressed package cannot be executed. Solution: failed to open archive interface.MPQ
- Method of modifying file and folder permission by Chmod command in Linux
- Perl application – delete “. SVN” folder in current directory and subdirectory
- Solution for error 7 in lineage OS brush
- Centos 7 | mariadb/mysql | [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
- Job for apache2.service failed apache2 cannot be started
- ADB remount failed: operation not permitted
- Install and uninstall under Linux system Node.js
- Busybox encountered input/output error while mounting NFS to TMP file system
- Linux error deletion libc.so.6 how to recover
- Solution to prompt “error opening terminal: xterm.” when making menuconfig
- Samba mount directory file rename strange failure
- FTP prompt in Linux — 553 could not create file (absolutely useful)