Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    ls and du report differently

    Redhat Linux 7.2
    Samba Version 2.2.1a

    ls -l output:

    /usr/samba# ls -l XPBackup00001.qic
    -rwxr--r-- 1 root root 6994328576 Dec 7 22:24 XPBackup00001.qic

    du -k output:

    /usr/samba# du -k XPBackup00001.qic
    25444 XPBackup00001.qic

    ls reports a 7- GB file, du reports a 25+ MG file, the later being less by a factor of almost 300.

    Obviously, "ls" and "du" must query different data. Can anyone advise how I can further trouble shoot this problem and identify what is causing the problem with the backup? It sounds like a data problem to me and my guess is the different data queried by the two commands will help me determine the bad data (and ultimately the cause of the problem).

    current troubleshooting steps:

    Other backups have been larger so I do not think file size is an issue.

    I have copied other larger good backups to the /usr/samba directory and they report fine (from ls and du) so I do not think it is a disk corruption problem. I ran fsck in the past, but right now cannot remember how I did it as fsck "strongly suggests" the file system be unmounted and I do not know how to tell what using the /usr file system (after stopping samba) to overcome the "device is busy" messages when I attempt to umount /usr (AIX had a lsof tool - do not know how to do the same on Linux). However, I remember doing something that would cause fsck to run on reboot, but cannot find it in the man pages and it is no longer in my shell history.

    more details:

    Using XP SP2 ntbackup.exe on a laptop writing to samba share on linux box. The verify process says the file is damaged. This occurs repeatedly when the entire C drive (only drive) is backed up. Have tried both with and without backing up the XP "System State". Have been backing up successfully for a couple years prior to this problem. It could be an XP SP2 problem as well as a few other potential items that have changed. My guess is that ntbackup.exe cannot handle certain data that has been introduced to my system

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    St. Petersburg, FL
    ls -s
    what does that say?

  3. #3
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    South- or "Mid-" Sweden
    I'd even say, use:
    ls -h file
    # and
    du -h file
    h stands for human readable.
    Regards Scienitca (registered user #335819 - )
    A master is nothing more than a student who knows something of which he can teach to other students.

  4. $spacer_open
  5. #4
    For the screen shot below
    - My PS1 variable is set to '${PWD}# '
    - The directory containing the file is /usr/samba
    - I added the original commands as well as "ls -lh" assuming that was what intended.


    ======== Begin Screen Capture ============
    /usr/samba# ls -s XPBackup00001.qic
    25444 XPBackup00001.qic
    /usr/samba# ls -h XPBackup00001.qic
    /usr/samba# ls -lh XPBackup00001.qic
    -rwxr--r-- 1 root root 6.5G Dec 7 22:24 XPBackup00001.qic
    /usr/samba# ls -l XPBackup00001.qic
    -rwxr--r-- 1 root root 6994328576 Dec 7 22:24 XPBackup00001.qic
    /usr/samba# du -h XPBackup00001.qic
    25M XPBackup00001.qic
    /usr/samba# du XPBackup00001.qic
    25444 XPBackup00001.qic
    /usr/samba# du -k XPBackup00001.qic
    25444 XPBackup00001.qic
    ======== End Screen Capture ============

  6. #5
    One minor technicality:

    The file displayed (XPBackup00001.qic) is acutally a backup file from Stomp's Backup MyPC 5.0. The same issue occurs with XP's ntbackup.exe. I tried Stomp's product to see if compression would fix the problem (ntbackup.exe does not allow compression unless you have a tape drive attached to your local system).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts