0 users browsing Discussion. | 1 guest | 8 bots  
    Main » Discussion » Declarative mount points?
    Pages: 1
    Posted on 18-12-19, 23:59 (revision 1)
    Post: #4 of 77
    Since: 10-31-18

    Last post: 973 days
    Last view: 899 days
    - Symlinks are declarative and don't require root (ln -s old new).
    - /etc/fstab is declarative but centralized, requires root to edit, and I don't understand them well.
    - The mount command is imperative, requires creating a folder first, and is highly stateful (you have to memorize the command used to mount unless there's a trick to obtain the right command-line from `mount` output, and it does not persist across reboots).

    I wish `mount`ing disks was as easy as symlinking, and mount information was stored within mount points, and persisted across reboots (or could be recreated with a single `remount` command without arguments).
    Posted on 18-12-20, 00:23
    Post: #14 of 204
    Since: 11-24-18

    Last post: 18 days
    Last view: 6 days
    Well, if it is something you do often, you *could* do:

    $ echo "alias mount-foo mount <device> <path>" >> ~/.bashrc; source .bashrc

    Then you would need to create the mount point once but after that, the alias does handle mounting for you.

    Not a perfect solution, but #worksforme
    Posted on 18-12-20, 03:19 (revision 1)
    Full mod

    Post: #69 of 443
    Since: 10-30-18

    Last post: 884 days
    Last view: 81 days
    1. Mount your filesystem the way you want it.

    2. Run "mount" (or consult /etc/mtab), find the line representing the filesystem you just mounted, and copy it to the clipboard.

    3. Set the $EDITOR environment variable to an editor you're comfortable with. If you like the GNOME editor gedit, use:

    $ export EDITOR=/usr/bin/gedit

    4. Edit /etc/fstab in your favourite editor with:

    $ sudo -e /etc/fstab

    sudo will copy the file to a directory you can write to, launch $EDITOR to edit it, and copy it back when the editor exits.

    5. Paste the output line you copied from "mount" at the end of the file

    6. In the fourth field, which has a bunch of comma-separated flags probably including things like "rw,relatime,errors=remount-ro", add an extra comma-separated flag "user". Make sure there's no extra space around the commas!

    7. Save and exit your editor.

    Now you can mount and unmount your filesystem with "mount /path/to/mount/point" and "unmount /path/to/mount/point" or "mount /path/to/device" and "unmount /path/to/device" without root privileges, and without having to remember all the special options every time.

    The ending of the words is ALMSIVI.
    Pages: 1
      Main » Discussion » Declarative mount points?
      Yes, it's an ad.