Repair grub on sdcard

  • Hello Forum,


    some days ago I installed Arakis on a microserver system. With a 32GB SDCard as root file system. All worked fine. Because of the omv extra flashmemory plugin, I removed the swap partition from the fstab file. But now 4GB space are unused (the swap partition). So I started fdisk and I used the old jedi trick:
    -- Delete the swap partition and then
    -- Delete the root partition and then
    -- Re-Create the root partition with fdisk beginning with the same sector and add the extra space. reboot+resize2fs+e2fsck
    -- (I left 100MB space unused at the end of the SDCard for a second primary partition.)


    But now the system does not start anymore. (Non-System disk or disk error). I started a linux live system. I checked the filesystem with force. I checked the bios and its not uefi. So I tried this manual.

    All seems fine, but after a reboot the error is still 'Non-System disk or disk error'


    Can someone give me a hint what I'm doing wrong?



    Thanks


    Peter


    Edit: After sending this posting to the forum, I got a message that an error occurs and that I have to send a ticket to the admin. So I posted it again. Sorry for the double posting. :(

    • Offizieller Beitrag

    I'm doing a reinstall. If someone has an idea about my problem, I would still know it, but I cant test it anymore.

    You have a 32gig flash drive, for an OS that if properly set up, will probably take barely 3...


    I'm thinking I would keep my Jedi skills in check and just let this one go

  • Not enough infos to debug now. Propably just a wrong grub.cfg
    Also, why would you do this without backup?? Changing partition tables on a system drive for no reason without backup makes me kind of think that a forced reinstallation has great educational value to learn to not to do something like this.

  • But this is the reason we are here. To alter, tune, optimize and finally crash a running system. This is what we do!


    I removed the swap partition by putting the sdcard into my laptop and resizing with gparted. Now I have my 4GB extra space. The flashmemory plugin tells me in the web gui to remove the swap partition from fstab. Because I removed it completely I got some errors in dmesg. I had to remove the swap partition uuid also from '/etc/initramfs-tools/conf.d/resume'.

  • I had to remove the swap partition uuid also from '/etc/initramfs-tools/conf.d/resume'

    Fair point.


    @ryecoaaron: should the comment on the flashmemory page mention this as well?


    Code
    echo "RESUME=none" >/etc/initramfs-tools/conf.d/resume
    update-initramfs -u

    BTW: especially for newbies I consider the recommendation to alter fstab a bit problematic since syntax errors might result in a bricked system, there shouldn't be much difference between Debian's relatime default and adding noatime,nodiratime manually. Also leaving swap configured but adjusting vm.swappiness to the minimum might be a better idea. So the whole comment could be reduced to a recommendation to do this: echo vm.swappiness=0 >>/etc/sysctl.conf. Or plugin installation could add this single line to the config file and execute the needed sysctl call? What do you think?

    • Offizieller Beitrag

    I would rather remove all of the info because people worry too much about these completely optional steps. I would probably add a checkbox that would
    echo 'vm.swappiness=0' > /etc/sysctl.d/swap.conf -or- rm /etc/sysctl.d/swap.conf (since I like using the .d directories for config files)
    and then execute
    sysctl --system

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

  • @ryecoaaron sounds both like a great idea to me :)


    With OMV5 (or Buster to be more precise) at least on x86 due to kernel 4.19 and a usually already existing swap partition another nice adjustment would be to set up zram instead and use the former swap partition as writeback device. This would need a systemd unit that sets up one zram device and also sets echo $former-swap-partition >/sys/block/zram0/backing_dev. Could be combined with reworking the flashmemory plugin to use another zram device instead of tmpfs.

    • Offizieller Beitrag

    Could be combined with reworking the flashmemory plugin to use another zram device instead of tmpfs.

    I like that idea and I looked into this a little bit. folder2ram would have to changed to use zram instead of tmpfs unless the plugin did the zram stuff itself. Trying not to reinvent the wheel, is there something from armbian we could start with?

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


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


    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!

Jetzt mitmachen!

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