0

i used this code to backup a directory to an ftp

mirror -R /media/root/7CBAA4537758FCA/SAVE/DeesBootCD_SlipStreamed2/ /luksftpmnt/put-into-images-folder/DeesBootCD_SlipStreamed2

and it worked well but some directories on original have small size but when copied they have no size.....the contents of these directories are correctly mirrored - all files same size, NO hidden files or symlinks that may have been corrupted.

Original directory example:

stat VCRTL/
  File: 'VCRTL/'
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 811h/2065d  Inode: 44034       Links: 1
Access: (0777/drwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-07-26 04:34:06.897335000 +0000
Modify: 2011-10-24 17:45:20.000000000 +0000
Change: 2015-07-25 01:49:32.655572000 +0000
 Birth: -

Remote ftp directory example:

stat VCRTL/
  File: 'VCRTL/'
 Size: 0            Blocks: 0          IO Block: 4096   directory
Device: 29h/41d Inode: 23451       Links: 1
Access: (0777/drwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-06-19 12:20:00.000000000 +0000
Modify: 2017-06-19 12:20:00.000000000 +0000
Change: 2017-06-19 12:20:00.000000000 +0000
 Birth: -
4
  • Errr, probably the LUKS(? did you mean FUSE?) FTP filesystem you're using just doesn't report directory size. So it's always 0.
    – derobert
    Jun 21, 2017 at 16:58
  • Is this what you're running: lftpfs.sourceforge.net ?
    – derobert
    Jun 21, 2017 at 17:00
  • @derobert yeah this happens to be luks encrypted drive. ...'so it's always 0' - yep its a fuser issue does not properly handle connections for ftp sshfs is more reliable.......
    – alex
    Nov 19, 2017 at 10:09
  • @derobert ........lftpfs.sourceforge.net WOW that must be the only lftp manual on the internet i did not see yet - largely same as lftp extensive manual but cool!! thanx i will add to my lftp bookmarks
    – alex
    Nov 19, 2017 at 10:16

1 Answer 1

0

The size of a directory¹ is not meaningful. It depends on the filesystem and, on some filesystems, on the history of the directory entries. (For example, on ext4, if a lot of files are created then removed in a directory, the directory's size increases to store all the entries but then does not shrink even when some of the space becomes unused because there are fewer entries.)

It looks like the filesystem on the FTP server doesn't report directory sizes at all. This doesn't indicate corruption in any way.

¹ I mean the size displayed by ls or stat, not the total size of the files it contains.

1
  • yes its an issue i suspect with ftp and fuser....switched to sshfs and fuser behaved a bit better....soon i will reattempt to try lftp on sshfs and see if that is a reliable solution.
    – alex
    Nov 19, 2017 at 10:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .