Timeshift and Structure Needs Cleaning

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
slimbrick87
Level 1
Level 1
Posts: 13
Joined: Sun Feb 18, 2018 12:41 pm

Timeshift and Structure Needs Cleaning

Post by slimbrick87 » Sat Jun 16, 2018 9:16 am

I've been having a 'Structure Needs Cleaning' when I mount a USB stick that has a timeshift snapshot on it. Mind you, this stick with the snapshot on it worked perfectly after I made the snapshot, but as soon as I reboot the system, the 'timeshift' directory on the stick shows 'Structure Needs Cleaning.' I tried to fix it by running 'fsck -y' after unmounting the USB stick and that fixes it so well the backup isn't there anymore. So bear with me and let me be specific on what I've done and how I tried to address the problem.

First, I format a 256 GB USB stick with the following:

Code: Select all

$ sudo fdisk /dev/sdc
n for new partition, defaults to ext4
w for write changes

Code: Select all

$ sudo mke2fs -t ext4 -O ^has_journal /dev/sdc1
Not having a journal is the only way I've found to get ext4 to work on USB sticks and I've used it with no problems in other applications.
Then I modify /etc/fstab to mount it on boot.

I run Timeshift and set up for weekly Snapshots. I set up Timeshift to capture user home directories of /root and /home/eric. The snapshot completes. Here is my df followed by ls -al in the main directory for the usb stick that captures the timeshot.

Code: Select all

eric@rome ~ $ df
Filesystem     1K-blocks     Used Available Use% Mounted on
...
/dev/sdc1      258029956 36666800 208239624  15% /mnt/Linux_Backup
...
eric@rome ~ $ cd /mnt/Linux_Backup
eric@rome /mnt/Linux_Backup $ ls -al
total 28
drwxr-xr-x 4 root root  4096 Jun  8 17:22 .
drwxr-xr-x 3 root root  4096 May 27 19:28 ..
drwx------ 2 root root 16384 Jun  8 11:20 lost+found
drwxr-xr-x 9 root root  4096 Jun  8 19:01 timeshift
eric@rome /mnt/Linux_Backup $ 
Everything looks good. Now, I unmount the usb stick and perform a fsck check and repair on the usb stick. There are errors:

Code: Select all

eric@rome ~ $ sudo fsck /dev/sdc1
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Linux_Backup contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'timeshift' in / (2) has deleted/unused inode 7471105.  Clear<y>? no
Entry 'timeshift' in / (2) has an incorrect filetype (was 2, should be 0).
Fix<y>? no
Entry '..' in <13250893>/<262145> (262145) has deleted/unused inode 13250893.  Clear<y>? no
Entry '..' in <13250893>/<262145> (262145) has an incorrect filetype (was 2, should be 0).
Fix<y>? no

....The list goes on and on.....

Code: Select all

Linux_Backup: ********** WARNING: Filesystem still has errors **********

eric@rome ~ $
So, I try to fix the errors with fsck...

Code: Select all

eric@rome ~ $ sudo fsck -y -t ext4 /dev/sdc1
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
Linux_Backup contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'timeshift' in / (2) has deleted/unused inode 7471105.  Clear? yes

Entry '..' in <13250893>/<262145> (262145) has deleted/unused inode 13250893.  Clear? yes

Entry '..' in <13250893>/<262146> (262146) has deleted/unused inode 13250893.  Clear? yes

Entry '..' in <13250893>/<262147> (262147) has deleted/unused inode 13250893.  Clear? yes
The errors go on and on, finally:

Code: Select all

Linux_Backup: ***** FILE SYSTEM WAS MODIFIED *****
Linux_Backup: 124970/16384000 files (0.4% non-contiguous), 2867825/65535744 blocks
Now I remount the USB, and go to the mountpoint, and the timeshift directory is all gone:

Code: Select all

eric@rome ~ $ sudo mount -t ext4 /dev/sdc1 /mnt/Linux_Backup
eric@rome ~ $ cd /mnt/Linux_Backup
eric@rome /mnt/Linux_Backup $ ls -al
total 24
drwxr-xr-x   3 root root  4096 Jun  8 17:22 .
drwxr-xr-x   3 root root  4096 May 27 19:28 ..
drwx------ 949 root root 16384 Jun  8 11:20 lost+found
eric@rome /mnt/Linux_Backup $
It's all in lost and found now, I'm sure. This is very annoying. Any advice for sorting this out?

Slim


Last bumped by slimbrick87 on Sat Jun 16, 2018 9:16 am.

Post Reply

Return to “Other topics”