Mounting on startup in 12.04

TopBot . topbot5 at googlemail.com
Tue Mar 18 21:43:51 UTC 2014


On Tue, Mar 18, 2014 at 12:49 PM, Nils Kassube <kassube at gmx.net> wrote:

> TopBot . wrote:
> > On Tue, Mar 18, 2014 at 1:44 AM, Nils Kassube <kassube at gmx.net> wrote:
> > > su USER -c "udisks --mount /dev/disk/by-label/Data"
>
> > Okay, I just added this to rc.local (replaced user with my actual
> > username) and rebooted... the device wasn't mounted on startup. Then
> > I tried this command manually in terminal:
> >
> > user at mypc:~$ su user -c "udisks --mount /dev/disk/by-label/Data"
> >
> > > Password:
> > > Mount failed: Not Authorized
> > > user at mypc:~$
>
> Well, I wasn't aware of that behaviour of udisks - maybe I should have
> tested the command ...
>
> While you tried the command as user and not as root (because rc.local is
> run by root), the output would be the same. It seems like the udisks
> command uses some feature which is tied to the individual GUI session.
> Then there are two options which have already been mentioned before: You
> could use a script which is run as an autostart command of the GUI
> session or you could use an fstab entry. I would suggest to use the
> first option because in another mail you wrote
>
>
That fact that got me curious was that why su can not pass the command as
the user from the terminal (or from rc.local as the user)... but the user
(directly from terminal without su) or the root as itself (from rc.local)
can pass it.


> | My case was that I do not want to do this permanently and do not want
> | to create backup versions of fstab, yet I want to disable this auto
> | mount just by removing or commenting the command which would be much
> | easier (I guess?) than editing fstab esp. in the cases when I'm
> | setting the same up for some one else (I find it easier to just go by
> | label and add a single command). I haven't edited fstab before, but if
> | there's something equally simple for that too, I would be open to that
> | too.
>
> If don't want this to be a permanent feature, it is better to use a
> script which is controlled by the user, not by root. IMHO there is no
> difference if you disable the command by commenting it in rc.local or by
> commenting the appropriate line in fstab. In both cases you are working
> with system files which is only allowed for root and errors may be
> fatal.
>
>
> Nils
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

Yes, I thought on Sajan's option about using "Start up applications". Turns
out I don't need to write a separate script even. Individual commands or
programs can be run as startup applications alike. So I just added "udisks
--mount /dev/disk/by-label/Data" as a startup command to be run on the
start. It's the simple most thing that does the trick. Thanks alot.

-- 
TopBot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20140319/e6fa2cf3/attachment.html>


More information about the ubuntu-users mailing list