[SOLVED] updatedb to locate

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Relative
Level 3
Level 3
Posts: 131
Joined: Fri Jul 30, 2010 9:43 pm
Location: Garden Grove, CA

[SOLVED] updatedb to locate

Post by Relative »

This is a somewhat general Linux question and I haven't been able to resolve it with searches.

I have a separate NTFS partition named 'Common' that is accessible by both Win7 and Mint. I would like to be able to use the 'locate' command to search this partition along with my /home partition.

I see where the update.conf file allows exclusions, but nothing about additions.

Is this possible?

Mike
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Mate 21.3 - MacBookPro2,1, MacBook2,1
Mate 21.3 - ThinkPad L430, ThinkPad T430, Dell N7110, iMac8.1, Toshiba A215
Mate 19.3 - (32-bit version) Old home-built P4 desktop.
Raspbian - Pi3 & Pi4.
All except P4 machine run cancer research 24/7.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: updatedb to locate

Post by xenopeek »

Temporarily mounted filesystems aren't indexed by updatedb nor are FUSE filesystems.

Have you configured /etc/fstab to permanently mount the filesystem? If so, is the mount location under another directory than /mnt and /media as those two directories are only for temporarily mounted filesystems.

If all that is already in place, you likely are using "ntfs-3g" as filesystem type in /etc/fstab. That is a FUSE filesystem, so in any case won't be indexed by updatedb. You either have to change the filesystem type to "ntfs" (the kernel driver which can only reliably read files from NTFS) as that isn't a FUSE filesystem IIRC, or you'd have to remove "fuse" from the PRUNEFS configuration in the updatedb configuration file. As FUSE filesystems are generally used for temporary mounts and for other things besides your NTFS filesystem, there may likely be side effects to this.

You can see examples for setting up /etc/fstab with ntfs-3g and with ntfs here https://help.ubuntu.com/community/Mount ... figuration
Image
Relative
Level 3
Level 3
Posts: 131
Joined: Fri Jul 30, 2010 9:43 pm
Location: Garden Grove, CA

Re: updatedb to locate

Post by Relative »

This is what the blkid command got me:
Note that /dev/sda10: is the one I wanted to access.

sudo blkid
/dev/sda1: SEC_TYPE="msdos" LABEL="DELLUTILITY" UUID="3030-3030" TYPE="vfat" PARTUUID="b3a6f9a5-01"
/dev/sda2: LABEL="RECOVERY" UUID="94AA2A65AA2A43D8" TYPE="ntfs" PARTUUID="b3a6f9a5-02"
/dev/sda3: LABEL="TPCW" UUID="C82EA7DD2EA7C334" TYPE="ntfs" PARTUUID="b3a6f9a5-03"
/dev/sda5: LABEL="TPDW" UUID="01CF6849BBFC5010" TYPE="ntfs" PARTUUID="b3a6f9a5-05"
/dev/sda6: LABEL="ThinkPadDriversEW" UUID="4367D098256C049F" TYPE="ntfs" PARTUUID="b3a6f9a5-06"
/dev/sda7: UUID="18b1d16c-d09f-4ef1-9c5e-7d8ac6d8cb64" TYPE="ext4" PARTUUID="b3a6f9a5-07"
/dev/sda8: UUID="0cf1b6fe-cae8-4ecc-b69b-bdd6c197f5c1" TYPE="ext4" PARTUUID="b3a6f9a5-08"
/dev/sda9: UUID="e857c971-eb32-4955-a64f-0d8d1a661349" TYPE="swap" PARTUUID="b3a6f9a5-09"
/dev/sda10: LABEL="Common" UUID="0DAB072D1F570530" TYPE="ntfs" PTTYPE="dos" PARTUUID="b3a6f9a5-0
a"

Common had been in /media/mike/Common

The following is what I added to fstab:
(I used ntfs-3g to enable writing to the files.)

# add Common ntfs partition to enable updatedb and locate to work with it
UUID=0DAB072D1F570530 /home/mike/Common ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0


locate works great now.

Many, many thanks for the solution.

Mike
Mate 21.3 - MacBookPro2,1, MacBook2,1
Mate 21.3 - ThinkPad L430, ThinkPad T430, Dell N7110, iMac8.1, Toshiba A215
Mate 19.3 - (32-bit version) Old home-built P4 desktop.
Raspbian - Pi3 & Pi4.
All except P4 machine run cancer research 24/7.
Relative
Level 3
Level 3
Posts: 131
Joined: Fri Jul 30, 2010 9:43 pm
Location: Garden Grove, CA

Re: [SOLVED] updatedb to locate

Post by Relative »

OK, so locate works great now, but the owner of everything in Common is root and that does me no good at all. How do I change that? 'chown' doesn't seem to do the trick.

Mike
Mate 21.3 - MacBookPro2,1, MacBook2,1
Mate 21.3 - ThinkPad L430, ThinkPad T430, Dell N7110, iMac8.1, Toshiba A215
Mate 19.3 - (32-bit version) Old home-built P4 desktop.
Raspbian - Pi3 & Pi4.
All except P4 machine run cancer research 24/7.
User avatar
xenopeek
Level 25
Level 25
Posts: 29615
Joined: Wed Jul 06, 2011 3:58 am

Re: [SOLVED] updatedb to locate

Post by xenopeek »

Don't know enough about ntfs-3g. Suggest to make a new topic requesting help to set the owner on a ntfs-3g mount.
Image
ajgringo619

Re: [SOLVED] updatedb to locate

Post by ajgringo619 »

Relative wrote: Sun Jul 29, 2018 10:08 pm OK, so locate works great now, but the owner of everything in Common is root and that does me no good at all. How do I change that? 'chown' doesn't seem to do the trick.

Mike
I did this to access my Windows 10 partition, giving myself ownership of the files:

Code: Select all

# Windows partition
UUID=046636D46636C668 /media/Windows ntfs uid=1000,gid=1000,dmask=027,fmask=137,windows_names 0 2
Relative
Level 3
Level 3
Posts: 131
Joined: Fri Jul 30, 2010 9:43 pm
Location: Garden Grove, CA

Re: [SOLVED] updatedb to locate

Post by Relative »

Your solution did the trick for me. The only thing I changed was to tie the partition to 'home' to enable 'updatedb' and 'locate' to work searching it. I went with ntfs instead of ntfs-3g. My impression is that ntfs-3g is the latest version but so far ntfs seems to do the job.

Here is what the final addition in fstab for my purposes:

UUID=0DAB072D1F570530 /home/mike/Common ntfs uid=1000,gid=1000,dmask=027,fmask=137,windows_names 0 2

Thanks to both ajgringo619 and xenopeek for the help.

Mike
Mate 21.3 - MacBookPro2,1, MacBook2,1
Mate 21.3 - ThinkPad L430, ThinkPad T430, Dell N7110, iMac8.1, Toshiba A215
Mate 19.3 - (32-bit version) Old home-built P4 desktop.
Raspbian - Pi3 & Pi4.
All except P4 machine run cancer research 24/7.
Locked

Return to “Software & Applications”