PowerButton & Grub Configuration?

  • Hi @ all,


    I built my first own NAS with Asrock Q1900 and OMV(System on separat SSD).
    Now I would like to instal Mint in paralel (this is not an issue).


    Now my question:
    I would like to config OMV to reboot/shutdown after pressing Powerbutton on the housing & during rebooting/shuting down to config Grub to boot Mint once after reboot. After the second reboot or power off OMV should boot normaly.


    Can somesome one help me to implemet such an option?


    Many thanks in advance,


    JD

  • Hi again,


    I found out how to configurate Grub for my needs


    but


    can some one please advise how can I "teach" OMV to reboot by pressing PW-Button and execute at the same time grub-reboot X ?
    (X= is the order nubber of the distri that will be booted)


    will it helps to edit: /etc/acpi/events/powerbtn


    event=button[ /]power (PWR.||PBTN)
    action=omv-pm-standby


    how is the syntax looks like then? what schoud i put instead of action=omv-pm-standby?
    action=grub-reboot X && shutdown -r now ??


    THX

  • HI subzero,


    did you read my question?


    sorry for been a bit provocative, but i don't think so.


    But any way thanks for your answer and "usfull" information.


    Can some one pls help and theoreticaly check if my proposal could work?

    • Offizieller Beitrag

    Actually, his response was pretty good and I read your post. The problem with what you want to do (other than boot a desktop distro on a server) is that you either need to tell it when to boot once or it will boot once every time. In the openmediavault-backup plugin, there are buttons to boot the utility distros once but you need to click the button each time you want that to happen. If you have that happen each time you push the power button, it will do it every time.


    It isn't easy to set the boot once option in grub.


    You have to have the default set to saved in the grub default file.
    The you have to set the default saved grub item with the command: grub-set-default ${DEFAULT}
    Then you have to update grub with: update-grub
    Then you have to tell it what grub item to reboot to: grub-reboot ${ENTRY}


    So, in the end, your idea isn't very feasible. Why don't you run Linux Mint in a VM using the virtualbox plugin?

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Maybe I need to go more further in detail to explain what I'm trying to do:
    Why to use Mint on server:
    I would like to have a combination of NAS and HTPC. NAS=OMV is the standart Distro running. HTPC will be used 1-2 times a week to watch some movies + to use skype and Websurfingr on my TV.
    So my idea is to to use Mint with Kodi as a second distro.
    Why not VM:
    To load Mint with Grub/VM etc. I will need to have a keyboard on my NAS. This I would like to avoid.
    So the plan is to control what will be booted - over PW Buton. Means: if OMV is running and PW button is pressed, system reboots to Mint and other way around if Mint is runing.
    (each time the button is pressed)
    My Idea is:
    0. Install OMV 1.9 and MINT Cinemon Rebeca on the same SSD
    1. in /etc/default/grub set GRUB_DEFAULT = saved (can you please help with the command for command line?)
    2. Grub: setup OMV as default distro in the grub--> would grub-set-default 4 be ok asuming OMV is the 5. entry or is the syntax not correct ?
    3. update-grub
    4. edit: /etc/acpi/events/powerbtn
    event=button[ /]power (PWR.||PBTN)
    action=grub-reboot 0 && shutdown -r now (asumming Mint is the 1. entry in Grub) (would be greate if you could advise for the command line command to set this value so I dont need to go in the nano editor(never used nano before))
    which would have the effect each time I'm pressing the PWbutton OMV will reboot to Mint.


    Would be great if you could look througt it and give me a short feedback if this will works or correct me if I'm wrong? (Unfortunately my Linux knowlage is very poor, so I would need your help)


    BTW: will it be easier for you if we would switch to German?


    Many thanks in advance,


    JD

    • Offizieller Beitrag

    You're fine with location. But I wouldn't put it where power button is, just create a duplicate one of pwrbtn and named it grub and put the single grub command inside. This is for the benefit of order. Similar to the conf.d/ many applications use in Linux.
    About the command grub, I am not sure. But is just a matter of testing. You can test in VM in a laptop so is faster, simulating kernel selection instead of another distro.

    • Offizieller Beitrag

    To edit /etc/default/grub:


    nano /etc/default/grub
    Change the GRUB_DEFAULT line.
    ctrl-o to save
    ctrl-x to exit


    With that power button code, it will reboot into Mint every time you push the power button.


    Just my opinion but I would buy an RPi2 and put OpenELEC on it. They make very htpcs.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Hi@all,


    @sub, tek,


    sorry,for such question but my linux expirience is on the very basic level.

    Zitat

    ...and put the single grub command inside. This is for the benefit of order. Similar to the conf.d/ many applications use in Linux.


    how this can be done? (as I told: I'm Linux NOOB)
    @aron,
    thanks for the explanation.

    Zitat

    With that power button code, it will reboot into Mint every time you push the power button.


    But as far as I have understood this will reboot to Mint only if I'm running OMV won't it?
    And during runing Mint PWbutton will do the action difined in mint won't it?


    Zitat

    Just my opinion but I would buy an RPi2 and put OpenELEC on it. They make very htpcs.


    It was my initial idea, but:
    1. I would have some organisatorical issues (don't want to go to much in detail)
    2. no skype/video telephonie on RPI possible
    3. I'm using Asrock Q1900 for NAs server, so its apitty to use this HW only for NAS


    So I will try my solution and will come back with info

  • tried my idea on OMV and clonezilla-> work fine


    But then I installed Mint
    Mint installed his Grub 2.
    After that there is no more clonezilla in the list and if I'm in OMV and do grub-reboot X nothins happens.
    Is it possible that Mint istalled second grub and not just updated an old one?
    how can i deactivate/deinstall grub from mint and use that old one from OMV?
    Or to set Grub from OMV as "primary grub"?


    ty


    JD

  • Solved with


    sudo apt-get update
    sudo apt-get --reinstall install grub-common grub-pc os-prober # grub-gfxpayload-lists
    sudo apt-get --reinstall install grub-common grub-efi-amd64 os-prober


    thx @ all for your help

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!