[SOLVED] AutoMounting of Partition Filesystems

  • On booting LE all the filesystems in the PC are mounted.

    I want to set it so that only the two partitions it needs are mounted.

    How is this best achieved?

    Explanation: I run LE at present from a LiveUSB stick and plug it into various PCs.
    I do not want any of the partitions in the PCs to be touched by LE.

    Thank you.

    Edited once, last by JohnBoyz (November 25, 2016 at 8:49 PM).


  • Some variant of automount - Disable mount for internal HDDs - Ask Ubuntu should work. In LE you can't edit the embedded rules but if you create a new rule in /storage/.config/udev.rules.d/99-no-internal-drives.rules it will run last and should cancel out the earlier embedded rule as all udev rules in all udev rule files are loaded in sequence and evaluated cumulatively.

    Thanks for the response.

    That would mount all partitions in the PC during boot, and then unmount them again. :(

    Not what I wanted to achieve ....... internal partitions not touched unless specifically directed by me.

  • Why does it matter? I've used openelec on multiple windows machines for years- I boot from sd / usb but stick the storage partition at the end of the main hard drive. Never had a single issue with the windows partitions.

    Edited once, last by trogggy (April 20, 2016 at 11:33 AM).

  • I think it should be possible to unsquash the SYSTEM file, edit some rule and then mksquash again.
    This would work?

    I would need to know what options to use for the mksquash command and also what edit to apply to which file ..... maybe
    /usr/lib/udev/rules.d/95-udevil-mount.rules ?


    If this would work can you (or anyone else) provide the info needed?

    Thanks.

    Edited once, last by JohnBoyz (April 20, 2016 at 12:04 PM).

  • Speaking of booting from portable, does le change the system time to utc like oe did in the past? It was super annoying to temporarily use on a Windows computer because win expected the system time to be the local time.

    I used to give oe flash drives set up with mysql to visitors so they could watch my movies on their laptops but they would always complain about the time getting messed up

  • I can't answer that - but if it is still a problem then you can get around it. I have:


    in all my advancedsettings.xml's as a matter of course, and don't have the issue.
    Although it's a minor nuisance when I'm in the uk.

    Edited once, last by trogggy (April 20, 2016 at 12:36 PM).

  • I did some small tests ...... unsquashed the SYSTEM file (to unsquashed directory) and did mksquash on the directory again.

    I seem to be missing something as the result from this command


    Code
    mksquashfs unsquashed  livecd.sqfs  -no-xattrs


    was very similar to the original file, except that the original reports


    Code
    Number of ids 2


    and the new file


    Code
    Number of ids 1


    Any ideas?

    Edited once, last by JohnBoyz (April 20, 2016 at 12:52 PM).


  • I think it should be possible to unsquash the SYSTEM file, edit some rule and then mksquash again.
    This would work?

    I would need to know what options to use for the mksquash command and also what edit to apply to which file ..... maybe
    /usr/lib/udev/rules.d/95-udevil-mount.rules ?


    If this would work can you (or anyone else) provide the info needed?

    Thanks.

    don't bother, just copy the file to where it is editable

    Code
    cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/


    you'll probably want something like

    Code
    SUBSYSTEM=="block", GOTO="exit"
  • don't bother, just copy the file to where it is editable

    Code
    cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/


    you'll probably want something like

    Code
    SUBSYSTEM=="block", GOTO="exit"

    Putting a copy into /storage would mean, as I understand it, that the original settings will be applied first and then the copy, which would cause the partitions to be mounted and then maybe unmounted again.

    Is this not the case?

    Thanks for the edit suggestion, I hope to try it soon by editing the file in the squashfs file.

  • Code
    cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/


    you'll probably want something like

    Code
    SUBSYSTEM=="block", GOTO="exit"

    I probably placed the above line in an incorrect position in the file, but the result was that I had no partitions auto mounted on boot up, but also I could not find a means to locate and mount any partition I might need, except on the network of course. I successfully mounted a network partition.

    All I want to achieve is not to have the partitions mounted, but to have their presence recognised and have them made available for mounting through the filemanager.

    Is it achievable?

  • I probably placed the above line in an incorrect position in the file, but the result was that I had no partitions auto mounted on boot up, but also I could not find a means to locate and mount any partition I might need, except on the network of course. I successfully mounted a network partition.

    All I want to achieve is not to have the partitions mounted, but to have their presence recognised and have them made available for mounting through the filemanager.

    Is it achievable?

    Nope. What's wrong with having them mounted?

    The only thing you could really do is create systemd automount services, but this isn't really a good solution.

  • Quote


    Nope. What's wrong with having them mounted?

    I have the OS on a USB stick which is nicely portable.
    It is bootable on most hardware.

    That hardware is not necessarily mine ..... and even if it was ....... I do not want unintended mounting of partitions in that hardware, but rather only mount a partition if a need arises.


    Quote


    The only thing you could really do is create systemd automount services, but this isn't really a good solution.


    I couldn't do it in any case, as I know nothing of systemd :D

    I will keep looking for alternatives, thanks ;)

  • I have the OS on a USB stick which is nicely portable.
    It is bootable on most hardware.

    That hardware is not necessarily mine ..... and even if it was ....... I do not want unintended mounting of partitions in that hardware, but rather only mount a partition if a need arises.


    I couldn't do it in any case, as I know nothing of systemd

    I will keep looking for alternatives, thanks

    I have a external drive with 2 partitions, the libreelec was mounted only the first. Now it is mount the 2 partitions. I had this changes:

    1) cp /usr/lib/udev/rules.d/95-udevil-mount.rules /storage/.config/udev.rules.d/

    2) edit the file: /storage/.config/udev.rules.d/95-udevil-mount.rules

    SUBSYSTEM!="block", KERNEL!="sd*|sr*|mmc*", GOTO="exit"
    -> SUBSYSTEM!="block", KERNEL!="sda?|sr*|mmc*", GOTO="exit"

    KERNEL=="sda?|mmc*", ENV{DEVTYPE}=="partition|disk", ENV{ID_FS_USAGE}=="filesystem", GOTO="harddisk"
    -> KERNEL=="sda?|mmc*", ENV{DEVTYPE}=="partition|disk", ENV{ID_FS_USAGE}=="filesystem", GOTO="harddisk"

    3) reboot de system

    I hope this help you...