Persistent USB mount locations on Pogoplug (and other Linux devices)
In a previous post, I talked about how I set up rsync on my Pogoplug Biz for church. I had mentioned a Couple of “Gotchas”, such as the way USB drives may be a different device name upon reboot. This makes it hard to find the Optware drive consistently. Here is my solution.
Basically, you want to get the e2fs libraries and programs, then use blkid and findfs to locate the drive. As of Oct 2011, the links below are correct, but be sure to check http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/ and replace the file names as necessary.
The commands below will download and copy the necessary libraries and e2fs utilities for mounting your flash drive in the same location. I am assuming you are going to use the device UUID instead of the drive lable to locate the drive, but both are possible. I also assume that you want to modify the NAND (the Pogoplug internal flash drive) as little as possible. I am ONLY copying the files necessary for this task of finding and mounting specific USB drives to specific locations upon reboot.
Getting the e2fs libraries and utilities
cd /tmp
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/e2fslibs_1.41.14-1_arm.ipk
tar xvzf e2fslibs_1.41.14-1_arm.ipk
tar xvzf data.tar.gz
wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/stable/e2fsprogs_1.41.14-1_arm.ipk
tar xvzf e2fsprogs_1.41.14-1_arm.ipk
tar xvzf data.tar.gz
Copying the e2fs files to the internal flash memory
The following command makes it possible to change the Pogoplug flash memory, so be careful from here on out! Also, I am assuming that /usr/sbin is on your PATH.
mount / -o remount,rw,noatime
cd /tmp/opt/lib
mv libb* /usr/lib
mv libc* /usr/lib
mv libe* /usr/lib
mv libu* /usr/lib
cd /tmp/opt/sbin
mv blkid /usr/sbin
mv findfs /usr/sbin
OK, this puts the files on the NAND and I can use blkid to locate the optware flash drive by UUID, and use findfs use in /etc/init.d/rcS to mount it to /opt. Next I need to locate the actual device UUID for the startup script. Run blkid to get the UUID, and write this down.
blkid
/dev/sda1: UUID="2CB9-87AD" TYPE="vfat" LABEL="LeeJones"
/dev/sdb1: UUID="fc640330-9e49" TYPE="ext3" LABEL="OPTWARE"
NOTE: the UUID and LABEL are case sensitive.
In this case, my Optware drive has a UUID of fc640330-9349. Now we should be able to locate the Optware USB drive (or any particular drive) with the findfs command:
findfs UUID="fc640330-9e49"
This returns the result of /dev/sdb1
Editing the startup /etc/init.d/rcS script
Using your favorite text editor, add the following line to /etc/init.d/rcS before anything calls /opt
mount `findfs UUID="fc640330-9e49"` /opt
NOTE: The character before findfs is a back quote (`) not an apostrophe ('). Look for the back quote on the tilde key (~) next to your number 1 key.
Once you have saved the changes to rcS, reboot:
mount / -o remount,ro
Extra Credit
Personally, I want to minimize the changes to my copy of /etc/init.d/rcS, so mine is the factory default one plus the following two extra lines at the end:
mount `findfs UUID="fc640330-9e49"` /opt # mounts Optware USB
#!/bin/sh
# runs optware startups in sort order
cd /opt/etc/init.d
for i in `ls S* | sort`
do
./$i start
done
Also, if I screw up on one on of my additions (been there) and disable my device, all I have to do is power off the Pogoplug, pull out the Optware USB drive and reboot. After a normal boot, I plug the drive back in and fix my mistake.

Thanks..
ReplyDeletevery useful
ReplyDeletethanks!
I really have to admit it’s quite a novelty to arrive at a relatively ‘different’ blog like this, great job. I expect I’ll be coming back fairly soon and I look forward to reading your next post when I do.
ReplyDeletepanerai replica
I have search your site through google.Thanks for sharing a beautiful and high quality informaton.i have a medical transcription
ReplyDeletecompany.again thanks...
very interesting post,i have bookmarked it,i have a list of cheap driving school in Alexandria,i wiill revist your blog.thanks...
ReplyDeleteIts Very Informative and useful blog! plz contact us for high quality work of seo services provider
ReplyDeletewao very impressive blog.i have search it through yahoo.its very amazing.i have online toys store for your kids.c u again
ReplyDeleteThanks, Can the same be done for the other drives as well so that they always mount with the same mnt_sd?# location?
ReplyDeleteThanks for your sharing .I just wonder how you manage to collect so many great articles in a week. You are so hardworking to read so many articles. Is PayPal good enough to be used? I love this article
ReplyDeleteOne thing that will really help you out with your spring cleaning is to invest in the right tools for organizing your home. If you don?t already have closet organizers, files for different documents and enough shelving, then spring is a good time to ma…
ReplyDeletevery nice blog and thanks for info
ReplyDeletethanks very much for sharing
betty and friends
i have search your blog from google its very amazing i have bookmark it for revisit,here is a mango exporters from pakistancompany,mango is a delcious fruit.
ReplyDeleteI just found your blog and want to say thank you! What an enjoyable time looking
ReplyDeletethrough so many sites. Thanks for sharing and keep up the good work till the end.
lawyer web design
What a cool post i have not seen anywhere thanks for share and keep up the good work.
ReplyDeleteTravel to Vietnam in Luxury Way
Really informative post thanks for share and keep up the good work.
ReplyDeleteChallenge Coins
It is superb and outstanding post thank you very much for share.
ReplyDeleteCommercial Real Estate Software
I have search your site from bing, its very up to dated and a good soucrce of information.i am Custom Lapel Pins Maker
ReplyDeleteI have this same question.
ReplyDelete"Thanks, Can the same be done for the other drives as well so that they always mount with the same mnt_sd?# location?"
Its very nice site to visit, I like your content style its Excellent effort for updating site. i really find unique content in your site.Lapel Pins
ReplyDeleteWord Count
ReplyDeleteI am spammer, but I am really happy to have participate in this discussion! Cheers.
A very well-written post. I read and liked the post and have also bookmarked you. All the best for future endeavors.
ReplyDeleteSolar water Heater
The post is very informative. It is a pleasure reading it. I have also bookmarked you for checking out new posts. Solar panels
ReplyDeleteThe post is handsomely written. I have bookmarked you for keeping abreast with your new posts.
ReplyDeleteSolar panel cost
The post is very informative. It is a pleasure reading it. I have also bookmarked you for checking out new posts.
ReplyDeleteSolar Panels for Home
Thanks for showing up such fabulous information. I have bookmarked you and will remain in line with your new posts. I like this post, keep writing and give informative post...!
ReplyDeleteSolar battery charger
Good efforts. All the best for future posts. I have bookmarked you. Well done. I read and like this post. Thanks.
ReplyDeleteEnergy solar panels
It is a pleasure going through your post. I have bookmarked you to check out new stuff from your side.
ReplyDeleteCommercial solar power
There are a number of points however which I believe would do better if you went into a little bit further detail than you have done. just my opinion, along with I’m not trying to be critical at all. If you do follow this up then I would be interested. Thanks.
ReplyDeletebuy youtube comments
Stock Tips
ReplyDeleteStock market tips are suggested to the investors in the Indian Stock market to provide them to gain healthy profit.
Online Share Trading
ReplyDeleteThere are many blogs and sites which give stock tips and analysis about stock market, traders can take advice form these sites & blogs
Your writing in your blog is so creative..it brings us a smile as we read it. Thank you...
ReplyDeleteDubai Audit
I absolutely love your blog and find most of your post’s to be exactly I’m looking for. Again, awesome weblog!
ReplyDeletedubai offshore company incorporation
It’s essential to have having access to the knowledge posted here
ReplyDeletecustom written papers
custom thesis papers
You seem to have a lot of confidence in the things you do. Nice post also! .
ReplyDeleteEssay Help service
It’s good site, I was looking for something like this
ReplyDeleteCheap essay papers
Exactly what I was looking for, regards for posting .
ReplyDeleteCustom Essay Writing Services
Perfect piece of work you have done, this internet site is really cool with superb info .
ReplyDeleteOnline custom essay writing service
Good work done by the blogger, Keep up the work going………….
ReplyDeletepaper writing service
Interesting blog post and very good website design, just bookmarked you. Thanks for sharing!
ReplyDeleteessay writing services
Thanks for the information and for sharing your knowledge.
ReplyDeletecompany registration dubai
Lord Krishna Packers Movers offers services like Packing and Moving household goods and office goods in Delhi and to all India. packers and movers delhi is a best site for transportations of packers and mover in delhi.
ReplyDeleteI like your idea, its different from a lot of other sites. Nice blog too.
ReplyDeleteDubai Auditors
It's Very informative and trustworthy post,keep posting as well as great work.
ReplyDeleteGreat post and thanks for sharing. It is really useful and helpful for me. Thank u…
ReplyDeleteDubai Auditors
Wohh just what I was looking for, regards for posting .
ReplyDeleteAcademic Writing Service
Incredible points. Sound arguments. Keep up the great work.
ReplyDeleteessay writing