Error OMV 5 on /boot SD after power lost

  • Hi, sorry for my poor english :(.

    I have an PI4 with OMV5 with docker, and more...

    For causes of a power outage problem, the Pi4 does not boot .. (fsck.vfat files recovery doesn't work) apparently the problem is in the partition / boot (256mb on partition /dev/mmcblk0p1 : is empty) of the SD card .. the second partition /dev/mmcblk0p2 seems to be correct with all configuration of omv, dockers,etc..

    Since I don't have a backup of OMV5:

    I thought about doing a fresh install on another SD with the correct /dev /mmcblk0p1 partition, (Boot correct) and copying the second /dev/mmcblk0p2 partition to new SD card of the same capacity (32GB) .. but.. the Boot /dev/mmcblkp1 partition is not the same... and get boot error...

    Something went wrong... I attach 2 images of estructure of SD card and Gparted..



    The question: is there any way to restore the / dev / mmcblk0p2 partition and make it work?

    Thanks and repeat, sorry for my english.

    • Official Post

    Since I don't have a backup of OMV5:

    ;(

    An ounce of prevention is worth a pound of cure.

    Backing up an SD card is stupid easy, but you have to do it before it breaks, not after. This is a really good and simple backup tutorial for all three platforms:

    https://thepi.io/how-to-back-up-your-raspberry-pi/


    There may be a way to do what you want (I don’t think so) but it will be kind of like cutting off a leg to get rid of that annoying limp. Just saying. Sorry.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

    • Official Post

    Your data is probably intact. You just need to make a fresh OMV install of your SD card. Unplug your hard drives and reinstall OMV. When you set up file systems don't reformat the drives, just mount them. Create shares and users exactly as you did with the first install and everything should be okay.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

  • A little disclaimer: This is my thoughts of what can be done to salvage your situation, I'm no expert on IT, just sharing what I would do if it was with me. Take it with a grain of salt...


    First of all, make a copy (or even two) of your old SD Card to somewhere safe. That way you can always try again with everything intact (well at least, not worst than already, :) )


    the second partition /dev/mmcblk0p2 seems to be correct with all configuration of omv, dockers,etc..

    [EDIT] After having this around the noodle, there is a easier way to try to fix this:

    You'll still need a USB card reader to use with the old SD Card.


    Flash a new SD card with the RaspOS that you used on the old SD card (desktop or lite).


    Boot your Pi with the new SD Card and do all updates/upgrades.


    When everything is done, shutdown the Pi and plug in the USB card reader with the old SD Card in it. (leave the new one there also)


    Boot the Pi and when the system is up and running do a: lsblk

    You'll have something like this:

    Code
    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda           8:0    0  29.6G  0 disk
    └─sda2        8:1    0  29.3G  0 part <<<---- Might be different but this is the old SD Card root
    mmcblk0     179:0    0  29.2G  0 disk
    ├─mmcblk0p1 179:1    0   256M  0 part /boot
    └─mmcblk0p2 179:2    0  28.9G  0 part /

    Now type blkid and will show something like this:

    Code
    /dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="4BBD-D3E7" TYPE="vfat" PARTUUID="738a4d67-01"
    /dev/mmcblk0p2: LABEL="rootfs" UUID="45e99191-771b-4e12-a526-0779148892cb" TYPE="ext4" PARTUUID="738a4d67-02"
    /dev/sda2: UUID="feb67ccf-d57a-41cc-a1d0-5b0d8e6011da" TYPE="ext4" PARTUUID="1c310018-1d9f-7244-be0b-a03609427f8d" <<<--- This is my partitions ID. !!!DO NOT USE THIS IDs!!!


    Take notice of the "LABEL" and "PARTUUID" of the "sda1" and "sda2" (you'll have to check what your's show), we will need it for the next steps.


    Open the fstab sudo nano /etc/fstab and change the PARTUUID of the root with the PARTUUID that you had seen from the "sda2" (or similar)

    PARTUUID=1c310018-1d9f-7244-be0b-a03609427f8d / ext4 noatime,nodiratime,defaults 0 1 <<-- AGAIN this are my configuration !!! DO NOT USE IT!!!


    Next, will edit the cmdline:

    sudo nano /boot/cmdline.txt and the same as before, change the PARTUUID with the one from above ---^^^"sda2". Will look like:

    console=serial0,115200 console=tty1 root=PARTUUID=1c310018-1d9f-7244-be0b-a03609427f8d rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait <<-- AGAIN !!!!DO NOT USE !!! This is my configuration. Your's will be different.

    Careful to NOT HAVE a line below it (as if you pressed ENTER). This is a single line.


    After all this, reboot and fingers crossed!!!!!


    Your Pi will boot from the new SD but will load the root folder from the old SD. Test it and if all is running (your OMV will spit errors maybe and docker, don't know if you had another HDD attached but that's a whole new thing to solve) at least you'll have the OS as was.


    [/EDIT]

    Below Spolier was my initial thinking but above is way simple, ;)


    Good Luck.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!