The officially official Devuan Forum!

You are not logged in.

#1 2025-03-14 07:28:42

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 169  

[SOLVED] how restore a root partition to a dual boot system ?

Hi,

I had on my laptop Devuan5 installed.

I created a backup of the full disk with fsarchiver

then I wiped the disk, installed Windows :'( , shrink-ed the size of the main partition ( where windows is installed ) to let room for devuan.

I installed a fresh devuan on that new partition (to get the dual boot from grub) and until here everything was working "smoothly".

Now I try to restore the backup of my previous devuan to overwrite the new install. but fsarchiver not only copies files it also interfere with UUID and more.. after restoration grub can't boot to devuan... hmm

Any ideas ?

Thanks.


Linux noob, plz be kind big_smile

Offline

#2 2025-03-14 10:21:47

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 169  

Re: [SOLVED] how restore a root partition to a dual boot system ?

OK when restoring my previous Devuan backup I did
(trough a devuan live medium)

fsarchiver restfs /data/myarchive1.fsa id=1,dest=/dev/nvme0n1p5,uuid=<the current UUID of this partition>

in this way fsarchiver do not restore also the old UUID.

after restoring and before reboot, I've mounted the restored and edited

/mnt/justrestored/boot/grub/grub.cfg
/mnt/justrestored/etc/fstab

in those files I've swapped the old UUID with the new one.

so I can boot on my restored devuan , but I lost the menu to boot into windows...

and when I boot devuan I got this message before (OCRed)

/dev/nvme0n1p5: clean, 152395/9635776 files, 8752630/36132812 blocks
INIT: version 3.06 booting
INIT: No inittad.d directory found
Using makefile-style concurrent boot in runlevel S.
Starting hot-plug events dispatcher: udevd[ 2.544361] udevd[418]: specified group *sgx* unknown
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Halting for /dev to be fully populated..^@[    2.908259] ucsi_acpi USBCOOesOO: ppm init failed (-16)
[    3.815309] [drm: amdgpu_pci_probe [amdgpu]] *ERROR* amdgpu requires firmware installed
[    3.815510] amdgpu: See https://wiki.debian.org/Firmware for Information about missing firmware
done.
Starting boot logger: bootlogd Setting up keyboard layout...done.
Activating swap...done.
Checking file systems...open: No such file or directory
fsck.fat 4.2 (2021-01-31)
fsck exited with status code 6
failed (code 6).
File system check failed.
A log is being saved in /var/log/fsck/checkfs if that location is writable.
Please repair the file system manually. ... failed I A maintenance shell will now be started.
CONTROL-D will terminate this shell and resume system boot. ... (warning).
Give root password for maintenance (or press Control-D to continue):_

Thanks.


Linux noob, plz be kind big_smile

Offline

#3 2025-03-14 12:44:46

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,564  

Re: [SOLVED] how restore a root partition to a dual boot system ?

I've never used fsarchiver, but I think the thing to do would be restore and then either boot an installer disk and choose Advanced options and then Reinstall bootloader, or else boot from live media and chroot into the installed system to run grub-install and update-grub. That will get the new UUIDs. For fstab, you have to edit manually.

But before you do that, you should repair the filesystem. When you get to the part that says give root password or ctrl-d, give it the root password and run fsck on whatever partitions it said failed.

Offline

#4 2025-03-14 13:31:52

RedGreen925
Member
Registered: 2024-12-07
Posts: 95  

Re: [SOLVED] how restore a root partition to a dual boot system ?

so I can boot on my restored devuan , but I lost the menu to boot into windows...

Well that is half the battle won, for the rest. Edit the file /etc/default/grub for this line.

root@9600k:~# grep -i prober /etc/default/grub
# probably want to run os-prober. However, if your computer is a host
# os-prober can cause damage to those guest OSes as it mounts
GRUB_DISABLE_OS_PROBER=true

Change it to false so it will probe for other OSs as you want then update-grub to have it done. Do this as root user or with sudo in front of the command when it does the updating you will see the OSs it will put in the menu listed in it output.

Edit: That of course assumes you have the menu enabled and a timeout set for it to do so.

GRUB_TIMEOUT=5

Last edited by RedGreen925 (2025-03-14 13:34:26)

Offline

#5 2025-03-14 18:23:47

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 169  

Re: [SOLVED] how restore a root partition to a dual boot system ?

Thank you @fsmithred and @RedGreen925,

I'm tempted by the chroot way.

I've used only once chroot...

so for this scenario I suppose I'll have to do something like

chroot /mnt/RestoredDevuan /bin/bash ?

--
Edit: I tried, but I got

error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. please specify --target or --directory

Last edited by SpongeBOB (2025-03-14 19:06:43)


Linux noob, plz be kind big_smile

Offline

#6 2025-03-14 22:37:30

RedGreen925
Member
Registered: 2024-12-07
Posts: 95  

Re: [SOLVED] how restore a root partition to a dual boot system ?

The Debian wiki has all the details, no clue on a mbr drive if that is what it is.

https://wiki.debian.org/GrubEFIReinstall

So what is the problem with running grub from the booted system to easy and uncomplicated to do?

Offline

#7 2025-03-15 07:06:55

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 169  

Re: [SOLVED] how restore a root partition to a dual boot system ?

Thank you @RedGreen !

I've followed the link,

The first solution didn't worked ( Using A Live CD/USB To Fix Your Current System )
grub-install /dev/nvme0n1
gived me the same error

error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. please specify --target or --directory

Then I tried rEFInd rescue media OMG ! it's awesome ! Actually GRUB should work like that ! smile
It show directly all my installed OS , and I could boot, Devuan, windows, etc..

Then I did

grub-install
update-grub

GRUB can now start Devuan smile but it removed the windows menu option...

I've tried

os-prober
update-grub

but it's not adding the entry in the GRUB menu.

( until I found a fix I can start it with rEFInd )

pZbKPQ3.jpeg

Last edited by SpongeBOB (2025-03-15 07:17:00)


Linux noob, plz be kind big_smile

Offline

#8 2025-03-15 15:59:24

greenjeans
Member
Registered: 2017-04-07
Posts: 782  
Website

Re: [SOLVED] how restore a root partition to a dual boot system ?

If grub is not recognizing your other partitions when you run update-grub, check /etc/default/grub and /usr/share/grub/default/grub files and make sure the os-prober is not disabled, on a fresh install of Devuan os-prober is disabled by default. Change the disable line from true to false as below:

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
GRUB_DISABLE_OS_PROBER=false

Last edited by greenjeans (2025-03-15 16:00:58)


https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded March 2025!
Vuu-do GNU/Linux, minimal Devuan-based openbox systems to build on, maximal versions if you prefer your linux fully-loaded. Now a Vuu-do-mate-mini as well.
New Devuan-mate-mini isos too! 100% no-vuu-do. wink
Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#9 2025-03-16 06:50:41

SpongeBOB
Member
From: Brussels
Registered: 2022-02-07
Posts: 169  

Re: [SOLVED] how restore a root partition to a dual boot system ?

Thank you @greenjeans 👍


Linux noob, plz be kind big_smile

Offline

Board footer