Re: extremely slow "ls" on a cleared fatty ext3 directory on FC4/5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 13 Aug 2006, Robinson Tiemuqinke wrote
that /tmp on an ext3 filesystem had held 5 million plain files,
that he deleted most of them,
that though the files are gone
just listing the remaining 8 files of /tmp
takes 20 minutes.

> -bash-3.00# ls -alFdh /tmp*
> drwxrwxrwt  4 root  staff 4.0K Aug 12 23:17 new_tmp/
> drwxrwxrwt  4 root  staff 131M Aug 12 20:30 tmp/
>
> Anyone know why the former fatty directory still looks
> unchanged and takes hours to traverse even after
> 99.999999% files got removed?

Another poster stated that on ext3,
directories can grow, but not shrink.

> If there are any ways to fix this kind of problem
> without rebooting machine? I'm afraid of the commands
> "rsync -avHn /tmp/ /new_tmp/; rm -rf /tmp/ && mv
> /new_tmp/ /tmp" because other applications are
> accessing /tmp/ as well.

If /tmp is its entire partition, I think that the only way
is to reformat the partition.
You don't necessarily have to reboot, but you will need to kick off
anyone using /tmp .

If /tmp is a soft link to /fred/tmp and /fred is its entire partition,
you might be able to do something like this.
# cd /fred
# mkdir new.tmp
# cd new.tmp
# ln ../tmp/*  .   # hard links won't work on directories
# cd ..
# mv tmp old.tmp
#  # 'twould be best if no one tried to use /tmp at this point
# mv new.tmp tmp
# rm -r old.tmp

There might still be problems if someone had the
original /tmp as the current directory or just open.

-- 
Mike   hennebry@xxxxxxxxxxxxxxxxxxxxx
"it stands to reason that they weren't always called the ancients."
                                                      --  Daniel Jackson

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux