Mounting on startup in 12.04

TopBot . topbot5 at googlemail.com
Tue Mar 18 03:09:21 UTC 2014


On Tue, Mar 18, 2014 at 1:44 AM, Nils Kassube <kassube at gmx.net> wrote:

> TopBot . wrote:
> > udisks --mount /dev/disk/by-label/Data
> >
> > It works great as a manual command in terminal but when i try to mount
> > the drive "Data" using the same command on startup by using the
> > command via rc.local, the data drive disappears from the side panel
> > and when I try to open it from /media/Data it says I do not have the
> > permissions to access content from the drive (which is not the issue
> > if i do it on normal basis)..
>
> The script rc.local is run by root at startup. Therefore root becomes
> the owner of the mounted drive if it is a FAT32 partition. OTOH if you
> used a ext2/3/4 partition the permissions would be stored in the
> filesystem for the individual files and it would work as expected
> (except only root can unmount the disk). So if you always want to mount
> it as the same user, you can modify the command like this:
>
> su USER -c "udisks --mount /dev/disk/by-label/Data"
>
> Replace the "USER" appropriately.
>
>
> Nils
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

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:~$
>

(PS. This was the result with the correct password.. output with the wrong
password is "su: Authentication failure").

Curious, why it wouldn't mount..

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


More information about the ubuntu-users mailing list