{"id":16,"date":"2006-09-08T03:12:41","date_gmt":"2006-09-08T10:12:41","guid":{"rendered":"http:\/\/www.dreness.com\/blog\/archives\/16"},"modified":"2006-09-09T13:14:09","modified_gmt":"2006-09-09T20:14:09","slug":"spotlight-indexes-on-read-only-media","status":"publish","type":"post","link":"https:\/\/dreness.com\/blog\/archives\/16","title":{"rendered":"Spotlight indexes on read-only media"},"content":{"rendered":"<p>Here&#8217;s a way to let spotlight do a full content index of a read only CD. It can even persist across uses :)<\/p>\n<pre>#!\/bin\/sh\r\n# pass in the name of the r\/o volume, e.g. DiskWarriorCD\r\n# this is proof of concept only. seriously :)\r\nif [ ! $1 ] ; then echo \"supply a volume name\" ; exit 1 ; fi\r\nvol=$1\r\nrodevpath=`df | grep \"$vol\" | awk '{print $1}'`\r\nfspath=`df | grep \"$vol\" | awk '{print $6}'`\r\nsudo hdiutil unmount $rodevpath\r\nsudo hdiutil mount $rodevpath -shadow \"\/tmp\/$vol.shadow\"\r\nsudo mdutil -i on $fspath\r\nsudo mdutil -s $fspath<\/pre>\n<p>I&#8217;m then able to return documents on the CD in my spotlight searches, create new files on the CD (in the shadow file) that are also indexed, etc&#8230;<\/p>\n<pre>{7} andre@idio [~] % rwmount Warrior\r\n\"disk2s1s3\" unmounted successfully.\r\n\/dev\/disk3                                              \/Volumes\/DiskWarriorCD\r\n\/Volumes\/DiskWarriorCD:\r\n        Indexing enabled for volume.\r\n\/Volumes\/DiskWarriorCD:\r\n        Status: Indexing Enabled\r\n{8} andre@idio [~] % echo \"nice marmot\" > \/Volumes\/DiskWarriorCD\/motd.txt\r\n{9} andre@idio [~] % mdfind marmot\r\n\/Volumes\/DiskWarriorCD\/motd.txt\r\n{10} andre@idio [~] % mdfind 'rebuild' -onlyin \/Volumes\/DiskWarriorCD\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/DiskWarrior CD Extras\/DiskWarrior \r\nAppleScripts\/Rebuild Directory\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/DiskWarrior Manual.pdf\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/DiskWarrior Read Me.rtf\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/Quick Start Manual.rtf\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/DiskWarrior CD Extras\/DiskWarrior \r\n3 Brochure.pdf\r\n\/Volumes\/DiskWarriorCD\/Applications\/Utilities\/DiskWarrior CD Extras\/DiskWarrior \r\nAppleScripts\/DiskWarrior and AppleScripts.rtf\r\n{11} andre@idio [~] % mount\r\n\/dev\/disk0s3 on \/ (local, journaled)\r\ndevfs on \/dev (local)\r\nfdesc on \/dev (union)\r\n<volfs> on \/.vol\r\n\/dev\/disk1s3 on \/Volumes\/Bay (local, journaled)\r\nautomount -nsl [180] on \/Network (automounted)\r\nautomount -fstab [184] on \/automount\/Servers (automounted)\r\nautomount -static [184] on \/automount\/static (automounted)\r\n\/dev\/disk3 on \/Volumes\/DiskWarriorCD (local, nodev, nosuid)<\/pre>\n<p>( physical CD is at disk2 )<br \/>\n( click eject button of DiskWarriorCD in Finder to unmount disk3)<\/p>\n<pre>{13} andre@idio [~] % hdiutil eject \/dev\/disk2\r\n\"disk2\" unmounted.\r\n\"disk2\" ejected.<\/pre>\n<p>(re-insert)<\/p>\n<pre>{15} andre@idio [~] % rwmount Warrior\r\n\"disk2s1s3\" unmounted successfully.\r\n\/dev\/disk3                                              \/Volumes\/DiskWarriorCD\r\n\/Volumes\/DiskWarriorCD:\r\n        Indexing enabled for volume.\r\n\/Volumes\/DiskWarriorCD:\r\n        Status: Indexing Enabled\r\n{16} andre@idio [~] % mdfind marmot\r\n\/Volumes\/DiskWarriorCD\/motd.txt<\/pre>\n<p>fun :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a way to let spotlight do a full content index of a read only CD. It can even persist across uses :) #!\/bin\/sh # pass in the name of the r\/o volume, e.g. DiskWarriorCD # this is proof of &hellip; <a href=\"https:\/\/dreness.com\/blog\/archives\/16\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-os-x","category-scripts"],"_links":{"self":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":0,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"wp:attachment":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}