slocate excluding / (root directory)

By webhat

I was running from a livecd to recover from a virus I got after somebody mistakenly put a USB stick in my laptop and ran an infected file from it. I always have auto-play off, and haven’t had a virus on this computer since I got it 3 years ago. My laptop came pre-installed with Windows XP, which was using NTFS disks. Sadly they didn’t think to not just run applications of the disk.

I needed to mount the disks and scan them with F-Prot, and as I couldn’t mount the NTFS drives read/write from the LiveCD I installed NTFS 3G. I mounted the disks and scanned the disks.

Before I mounted the disks I wanted to see if there was a NTFS driver or anti-virus on the LiveCD, but I wasn’t able to find the files as slocate (updatedb) wasn’t indexing the root partition. I discovered this in /etc/mtab and /proc/mounts contained the following:

rootfs / rootfs rw 0 0
tmpfs / tmpfs rw 0 0

Obviously this wouldn’t work as slocate doesn’t index tmpfs, so removing the line from /etc/mtab solved that problem.


Leave a Reply