OUR NETWORK:TiVoCommunity TechLore MyOpenRouter Dijit Community MediaSmart Home See all... About UsAdvertiseContact Us

 
Learn about scoring Forum's Raw Score: 111990.0
September 13, 2011 12:43 PM

Categories: PogoPlug Development

Rating (0 votes)
  • 1
  • 2
  • 3
  • 4
  • 5
Rate This!

Member Avatar

Lee Jones

Member
Joined: 08/29/2011

Is there any way to prevent a disk from being auto-mounted by the "cemnt" process? Something in cefs.conf for example?

I have a EXT3 filesystem that I use to run rsync, and I don't want the web site to pick it up.

So far, I have not managed to eject the drive from SSH, either.

Lee Jones

Discussion:    Add a Comment | Comments 1-7 of 7 | Latest Comment

September 15, 2011 10:34 AM

Anybody know if I can prevent the pogoplug mount discovery process frpm mounting particular usb drives? Or at least hide them from the "virtual users" created by the web interface?

Lee Jones

September 18, 2011 11:19 AM

I, too, want this.

I was about to start a thread titled "How to avoid auto-mounting the Optware drive by cemnt?" but I guess your title will work fine, Lee.

Check out my 1-Wire Weather Station/Cam hosted on a PogoPlug . . . . . http://davysweather.dyndns.org

September 18, 2011 1:32 PM

I have figured out a way to do this, but it's not "safe"... basically, you let hbmgr.sh do its thing, then tell it to stop.

It looks like hbmgr.sh starts dropbear, but it does not stop dropbear.

Anyway, with the hbplug process stopped, there are still block devices named sdX1 in /tmp/cement, so I tried deleting the block device file and creating a file by the same name. Restarting hbmgr.sh at this point seemed to cause the cemnt process to fail to mount the device.

I haven't done much experimenting beyond this. But, support basically tells me it can't be done. There's a feature request in the works though.

Next, I would want to use blkid and findfs to locate the device by UUID in order to automate the process. I already do this during /etc/init.d/rcS for mounting my /opt folder reliably, so it shouldn't be too big of a stretch.

Lee Jones

September 18, 2011 2:54 PM

@ Lee: Any chance you could share your code/methods? ... for me, a proceed-at-your-own-risk disclaimer is already understood...

Check out my 1-Wire Weather Station/Cam hosted on a PogoPlug . . . . . http://davysweather.dyndns.org

September 18, 2011 8:26 PM updated: September 18, 2011 8:31 PM

Well... First, get blkid and findfs on your path. You can get them from e2fsprogs and e2fslib as part of Optware. Next, get the UUID of your USB drive that you want to hid with the blkid command.

In my case, I want to hide a EXT3 USB flash drive, mounted as /opt, from the my.Pogoplug.com web site. I put the script in /opt/etc/init.d/S58hidefromce and added it to /etc/rcS after /opt is mounted.

For my example, my EXT3 flash drive's UUID (per blkid) is fcdf4330-9ef9-fad8-a245-f3cf9bef5e6b

#!/bin/sh

# /opt/etc/init.d/S58hidefromce
# Used to mask a particular device (by UUID from blkid) from hbwd / hbmgr.sh / cemnt / my.pogoplug.com

HIDEME=`findfs UUID=fcdf4330-9ef9-fad8-a245-f3cf9bef5e6b | cut -d"/" -f3`

sleep 30
/etc/init.d/hbmgr.sh stop
rm /tmp/.cemnt/$HIDEME
> /tmp/.cemnt/$HIDEME
/etc/init.d/hbmgr.sh start

There are a few drawbacks... For example, I'm not checking to see if hbwd is already running, so by attempting to hide it, I will actually start the process (because I try to stop it, then start it). Second, if hbwd never ran, I think the process would fail because I am not checking for the .cemnt folder. Also, I'm not checking if findfs succeeds or not, I just assume it does (if you typo the UUID, it fails). You need to install findfs first... blah blah blah.

On the other hand, if you get the UUID right, this should work every time. Now, I am running it from /opt (the very drive I am trying to hide) because I only want it to run IF the drive I am hiding mounted to /opt successfully. YMMV.

Lee Jones

September 18, 2011 8:51 PM

YMMV, indeed! (rofl!) I usually break things first, and then fix them. On a bad day I break them badly, badly enough that I can't fix them. ;)

I like what you put up - good thinking. I never considered using the UUID (but then I just opened my box a few days ago...).

What you show here, I will try, ... and maybe you and others (including Pogoplug's developers) will come up w/ some of those other "sanity" checks and error handling.

Once I try it, I will let you know my MPG.

Check out my 1-Wire Weather Station/Cam hosted on a PogoPlug . . . . . http://davysweather.dyndns.org

October 19, 2011 9:52 AM

BTW... I did see a bunch of core files in /tmp, probably because of this, so I added a cron job to delete the core files.

Lee Jones

Discussion:    Add a Comment | Back to Top | Comments 1-7 of 7 | Latest Comment

Add Your Reply

(will not be displayed)

Email me when comments are added to this thread

 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window