Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: mount command in .profile not executing

  1. #1

    Default mount command in .profile not executing

    I used to place some mount commands into /etc/init.d/boot.local but that file is GONE. I want to mount my data partition /dev/sdaXY under /0/saXY but cannot get Yast to do it into /etc/fstab (I haven't tried to edit fstab manually so far, want the partition world writable). Next attempt was to put it into ~/.profile with a few other commands. The other commands all execute but not the mount command even though the user IS mount authorised in sudoers.

    What I would really like is a place for a bash script executed as root if possible with echo statements during, just like boot.local USED to be. What can I do?


    Speaking of echo, how do I once and for all get rid of all flash or masking screens? I want to see all processes scroll by until "I" log into X.

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,706
    Blog Entries
    1

    Default Re: mount command in .profile not executing

    Quote Originally Posted by fitterski View Post
    I used to place some mount commands into /etc/init.d/boot.local but that file is GONE.
    Yes, that was announced here
    https://lists.opensuse.org/opensuse-.../msg00400.html

    I want to mount my data partition /dev/sdaXY under /0/saXY but cannot get Yast to do it into /etc/fstab (I haven't tried to edit fstab manually so far, want the partition world writable).
    A bit too vague for anyone to assist meaningfully. If you can mount manually from a terminal, then post the working mount command, and someone can show you how to enter this as an /etc/fstab entry.

    If you really want to mount via a script executed at boot, you could still create a custom unit eg /etc/systemd/system/mount.service (similar to the deprecated rc-local.service)...

    Code:
    [Unit]
    Description=custom mount service
    After=basic.target
    
    [Service]
    Type=forking
    ExecStart=/path/to/your/script
    TimeoutSec=0
    RemainAfterExit=yes
    
    [Install]
    WantedBy=multi-user.target
    Once you have a working executable script, point the service at it 'ExecStart=', and then enable and start it
    Code:
    systemctl enable mount
    Code:
    systemctl start mount

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: mount command in .profile not executing

    As you earlier mounted it through init.d, you most probably want to have it mounted at boot. But the normal way to mount a file system at boot is of course through /etc/fstab. And that has not changed.

    Thus I translate your request into: please help me to create a correct entry in /etc/fstab (something that should have been done long ago). And as you apparently managed to mount it to your wish, your mount statement must only be translated into an fstab entry. So do as suggested, tell how you mount.
    Henk van Velden

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,470
    Blog Entries
    2

    Default Re: mount command in .profile not executing

    Quote Originally Posted by hcvv View Post
    As you earlier mounted it through init.d, you most probably want to have it mounted at boot. But the normal way to mount a file system at boot is of course through /etc/fstab. And that has not changed.

    Thus I translate your request into: please help me to create a correct entry in /etc/fstab (something that should have been done long ago). And as you apparently managed to mount it to your wish, your mount statement must only be translated into an fstab entry. So do as suggested, tell how you mount.
    What you say is <mostly> true that a standard way to mount on boot is an fstab entry.
    But, there are also new systemd mount services of which I only pay passing interest because they have changed significantly at least once historically... Yes, the last time I checked now there are several mount services.

    An example where a systemd mount service is used is in VMware, mounting shared folders.

    So,
    With a little research you <could> identify the systemd mount service that's most appropriate and add an entry for what you want to do.

    As noted...
    What you're now trying to do by adding an entry to ~/.profile is not similar to what you were doing before.
    It should be possible to do what you're trying to do, but you need to provide concrete details about what you're trying that is failing.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: mount command in .profile not executing

    I forgot to say that I'm using Splashma5, it is a factor in that Dolphin is running under it (later).

    The reason I had this

    Code:
    mount /dev/sda14 /0/sa14
    in /etc/boot.local was that I had a lot of other lines in there as well so it was a matter of convenience. I know how to edit fstab or how to use Yast Partitioner to have IT edit fstab. It's this Yast bit that had me doing flips the last couple of times together with Dolphin. At a given point in trying to get Yast to mount the partition I now get

    Code:
    Mounting /dev/sda14 at /0/sa14
    Device not found. sid 77
    Continue despite the error?
    Continue   -   Abort
    However at this point in time Yast _has_ already mounted /dev/sda14 and kdf shows it mounted. When I click Continue it gets entered into fstab but Dolphin still cannot open on it because for some reason Dolphin is getting to be so useless that it needs to be relaunched just about every time something gets mounted or unmounted. Anyway, I've got what I want, I could edit fstab from

    Code:
    /dev/sda14  /0/sa14  ext4  data=ordered                 0  0
    to

    Code:
    /dev/sda14  /0/sa14  ext4  users, data=ordered                 0  0
    but it's not required now.


    All the other methods involving systemd are too complicated as far as I'm concerned, not wanting to get any deeper into the systemd topic at all.

    As far as ~/.profile goes it DOES execute other commands so I'm back to the original question: why does it not execute mount if the user is listed in sudoers for urestricted /bin/mount or umount? Does splashma5 ignore something as central as sudoers?

  6. #6

    Default Re: mount command in .profile not executing

    Hi,

    Everything is about systemd now. Your command entry in boot.local fails probably because the targets that needs to manage the device/file system is not yet running so it does not find the device that you're trying to mount. Now since you mentioned about Dolphin, dolphin can mount disk as a normal user and afaik dolphin is using udisksctl.

    Code:
    udisksctl mount -b /dev/sda1
    To unmount just replace mount with unmount.

    Code:
    udisksctl unmount -b /dev/sda1
    To find more info

    Code:
    udisksctl --help
    or try the man page.
    Code:
    man udisksctl
    About the sudo part, I can't say anything about it since i don't usually use that utility, sorry old habits
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  7. #7

    Default Re: mount command in .profile not executing

    Quote Originally Posted by fitterski View Post
    I forgot to say that I'm using Splashma5, it is a factor in that Dolphin is running under it (later).

    All the other methods involving systemd are too complicated as far as I'm concerned, not wanting to get any deeper into the systemd topic at all.
    Hi,

    Have you tried writing a SysV init script in the past?
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  8. #8

    Default Re: mount command in .profile not executing

    [QUOTE=jetchisel;2856673]Hi,

    Everything is about systemd now. Your command entry in boot.local fails probably because the targets that needs to manage the device/file system is not yet running so it does not find the device that you're trying to mount. Now since you mentioned about Dolphin, dolphin can mount disk as a normal user and afaik dolphin is using udisksctl.[/CODE]

    Suse-13.2 still uses the boot.local file and the command there works, in TW it just isn't there anymore, it doesn't fail. I tried this udisksctl but it doesn't let me set the mountpoint which just doesn't cut it.

    About the sudo part, I can't say anything about it since i don't usually use that utility, sorry old habits

    No sweat, thanks for he input. Sudoers empower common mortals for the use of root authority. The problem (I think) is that Splashma like all KDE before simply ignores it.

  9. #9

    Default Re: mount command in .profile not executing

    Quote Originally Posted by jetchisel View Post
    Hi,

    Have you tried writing a SysV init script in the past?
    I don't think I have but it's really not a problem. Boot.local is toast and !/.profile cannot do it so for now I'll just edit fstab. I also have bash scripts that mount/unmount things all over the place to predefined dedicated mountpoints on a click but /dev/sda14 is such a general data partition that I was happy with it being mounted right off the bat for the entire session. Actually the root problem wasn't that it cannot be mounted by boot.local but that boot.local is gone, period. I'll just use ~/.profile for what it CAN do and my clickable scripts for anything else.

  10. #10
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,706
    Blog Entries
    1

    Default Re: mount command in .profile not executing

    Quote Originally Posted by fitterski View Post
    I don't think I have but it's really not a problem. Boot.local is toast...
    Yes, but I already showed you how to create a custom systemd service (based on the rc-local.service with boot.local). Point is at one of your mount scripts, and it should achieve the same operation as before.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •