• Re: status: how to install grub to non-bootable RAID-formatted drive?

    From Alexander V. Makartsev@3:633/10 to All on Saturday, January 24, 2026 12:10:03
    On 1/23/26 20:29, D. R. Evans wrote:
    ...
    So, given all the above, I intend to proceed with:

    cp -r /dev/ /tmp/RFS/dev/
    chroot /tmp/RFS /usr/bin/bash
    grub-install /dev/sda
    sync
    exit
    reboot

    after I've given people a bit of time to shout at me not to do that if something in what I've written above looks bad.
    "cp -r /dev/ /tmp/RFS/dev/"? is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda
    like files into /tmp/RFS, basically into itself until it runs out of
    free space.
    You need to double check if "/dev/sda" is the disk you want to recover. Commands like:
    ? ? blkid
    ? ? ls -la /dev/disk/by-id
    ? ? smartctl -i /dev/sda
    ? ? mdadm --misc --detail /dev/md126
    should help you identify it correctly.
    Taking everything into consideration the right sequence of commands
    should be:
    ? ? mkdir /tmp/RFS
    ? ? mount?/dev/md126?/tmp/RFS? ? #Mount root filesystem
    ? ? mount --bind /dev /tmp/RFS/dev? ? #Mount bind real /dev to populate chroot-ed /dev
    ? ? mount --bind /proc /tmp/RFS/proc? ? #Mount bind real /proc to
    populate chroot-ed /proc
    ? ? mount --bind /sys /tmp/RFS/sys? ? #Mount bind real /systo populate chroot-ed /sys
    ? ? chroot /tmp/RFS /usr/bin/bash? ? #Change root into directory /tmp/RFS
    ? ? grub-install --target=i386-pc /dev/sda? ? #Install grub stage 1 and
    stage 2 MBR bootloader into /dev/sda and /boot
    ? ? sync? ? #Sync filesystems
    ? ? exit? ? #Exit chroot
    ? ? umount /tmp/RFS/dev
    ? ? umount /tmp/RFS/proc
    ? ? umount /tmp/RFS/sys
    ? ? umount /tmp/RFS
    ? ? systemctl reboot
    Hopefully grub-install will recognize raid partition correctly and
    create working grub config.
    Before exiting chroot you can check "/boot/grub/grub.cfg" for filesystem
    UUIDs and compare them to the output from "blkid" command:
    ? ? cat /boot/grub/grub.cfg | grep -iE -- "--set=root"
    ...
    search --no-floppy --fs-uuid --set=root 155380c9-4578-4a85-80c3-a78c7ffa7cb1 ...
    ? ? blkid --uuid 155380c9-4578-4a85-80c3-a78c7ffa7cb1
    /dev/nvme0n1p5
    "/dev/nvme0n1p5" is my boot partition, your UUIDs and blkid output will
    be different.

    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From alain williams@3:633/10 to All on Saturday, January 24, 2026 12:20:01
    On Sat, Jan 24, 2026 at 04:09:12PM +0500, Alexander V. Makartsev wrote:
    On 1/23/26 20:29, D. R. Evans wrote:
    ...
    So, given all the above, I intend to proceed with:

    cp -r /dev/ /tmp/RFS/dev/
    chroot /tmp/RFS /usr/bin/bash
    grub-install /dev/sda
    sync
    exit
    reboot

    after I've given people a bit of time to shout at me not to do that if something in what I've written above looks bad.
    "cp -r /dev/ /tmp/RFS/dev/"ÿ is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda like files into /tmp/RFS, basically into itself until it runs out of free space.

    No it will not. It will copy the block/character devices as files of type b & c, this will result in /tmp/RFS/dev/ being 100k or so.

    Doing a 'mount --bind' is, however, better than my suggestion of copying.

    --
    Alain Williams
    Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
    +44 (0) 787 668 0256 https://www.phcomp.co.uk/
    Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
    #include <std_disclaimer.h>

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From tomas@3:633/10 to All on Saturday, January 24, 2026 12:40:01
    On Sat, Jan 24, 2026 at 11:18:39AM +0000, alain williams wrote:
    On Sat, Jan 24, 2026 at 04:09:12PM +0500, Alexander V. Makartsev wrote:
    On 1/23/26 20:29, D. R. Evans wrote:
    ...
    So, given all the above, I intend to proceed with:

    cp -r /dev/ /tmp/RFS/dev/
    chroot /tmp/RFS /usr/bin/bash
    grub-install /dev/sda
    sync
    exit
    reboot

    after I've given people a bit of time to shout at me not to do that if something in what I've written above looks bad.
    "cp -r /dev/ /tmp/RFS/dev/"ÿ is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda like files into /tmp/RFS, basically into itself until it runs out of free space.

    No it will not. It will copy the block/character devices as files of type b & c, this will result in /tmp/RFS/dev/ being 100k or so.
    Not special files, that's right, but it will "unfold" symlinks, attributes
    migt be wrong, etc. etc.
    Better use "cp -a", or at least "cp -pr" but...
    Doing a 'mount --bind' is, however, better than my suggestion of copying.
    absolutely this.
    Cheers
    --
    t


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Greg Wooledge@3:633/10 to All on Saturday, January 24, 2026 15:40:01
    On Sat, Jan 24, 2026 at 16:09:12 +0500, Alexander V. Makartsev wrote:
    "cp -r /dev/ /tmp/RFS/dev/"? is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda like files into /tmp/RFS, basically into itself until it runs out of free space.

    A reasonable guess, but it's not correct.

    hobbit:~$ mkdir d1
    hobbit:~$ mkfifo d1/pipe
    hobbit:~$ cp -r d1 d2
    hobbit:~$ ls -l d1 d2
    d1:
    total 0
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    d2:
    total 0
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    =============================

    hobbit:~$ ls -l /dev/null
    crw-rw-rw- 1 root root 1, 3 Jan 14 18:21 /dev/null
    hobbit:~$ sudo mknod d1/null c 1 3
    [sudo] password for greg:
    hobbit:~$ sudo rm -rf d2
    hobbit:~$ sudo cp -r d1 d2
    hobbit:~$ ls -l d1 d2
    d1:
    total 0
    crw-r--r-- 1 root root 1, 3 Jan 24 09:27 null
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    d2:
    total 0
    crw-r--r-- 1 root root 1, 3 Jan 24 09:27 null
    prw-r--r-- 1 root root 0 Jan 24 09:27 pipe|

    =============================

    Of course, the bind mount solution is better than the cp solution in
    this case. But the cp solution isn't as wrong as you believed. One
    would probably want to use -a instead of -r, though, to copy the
    permissions and ownerships.

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David@3:633/10 to All on Saturday, January 24, 2026 19:10:01
    (I am re-sending the message below, because I mistakenly
    sent it privately to Doc 18 hours ago, instead of to the list,
    and we both agree that it's better to keep all disussion on the
    list)

    On Fri, 23 Jan 2026 at 15:30, D. R. Evans <doc.evans@gmail.com> wrote:

    There's been a bit of conflicting advice here; so here's a new thread, describing where I am in Alain's original suggested sequence (some of this is a recap from earlier e-mails):

    [...]

    So, given all the above, I intend to proceed with:

    cp -r /dev/ /tmp/RFS/dev/
    chroot /tmp/RFS /usr/bin/bash
    grub-install /dev/sda
    sync
    exit
    reboot

    after I've given people a bit of time to shout at me not to do that if something in what I've written above looks bad.

    Hi, thanks for making the effort to communicate well.
    I'm not going to shout at you because I'm not that kind of person.
    Just wanted to respond briefly ...

    I've never used 'cp /dev' command to setup 'chroot', I think 'mount --bind'
    is the modern and safer method.

    I'm also not going to checking through the rest of the above because
    it looks like pointless effort, unless you find that grub-rescue does
    not work for you, as I wrote previously. Fixing this kind of situation
    is exactly the purpose that the grub-rescue prompt exists and is
    offered to you, so I don't understand why you would want to
    ignore it, unless it proves not to work for you.

    It's right there in the name: grub rescue.

    But, I don't mind what you do, have fun with it, let us know how
    it works out :)

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Alexander V. Makartsev@3:633/10 to All on Saturday, January 24, 2026 21:50:01
    On 1/24/26 21:30, D. R. Evans wrote:
    Alexander V. Makartsev wrote on 1/24/26 4:09 AM:
    ? ? ? grub-install --target=i386-pc /dev/sda? ? #Install grub stage 1
    and
    stage 2 MBR bootloader into /dev/sda and /boot

    Produces the following message twice:
    ? grub-install: warning: Couldn't find physical volume '(null)'. Some modules may be missing from core image.

    That is followed by:
    ? Installation finished. No error reported.

    Should I be worried about the two warning messages. (And, if so, what
    do I do about them).
    It looks like these warnings appear when you try to install grub into
    disk which contains RAID array in a degraded state. [1]
    Try to boot from this disk now, if boot will be successful then you've
    done with grub and the next step is to replace missing drive and resync
    the array.

    [1] https://serverfault.com/questions/617552/grub-some-modules-may-be-missing-from-core-image-warning
    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From alain williams@3:633/10 to All on Saturday, January 24, 2026 23:00:01
    On Sat, Jan 24, 2026 at 01:42:26PM -0700, D. R. Evans wrote:

    Yes, I'm thinking about doing that; I've been kind of waiting to see whether Alain has a comment on that particular line.

    Stefan originally said, when introducing the idea of the "mount --bind" command:

    mount --bind seems better than 'cp -r' (or cp -a). I have added it to my private notes on this sort of thing.

    --
    Alain Williams
    Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
    +44 (0) 787 668 0256 https://www.phcomp.co.uk/
    Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
    #include <std_disclaimer.h>

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tom Dial@3:633/10 to All on Sunday, January 25, 2026 03:30:02


    On 1/24/26 07:33, Greg Wooledge wrote:
    On Sat, Jan 24, 2026 at 16:09:12 +0500, Alexander V. Makartsev wrote:
    "cp -r /dev/ /tmp/RFS/dev/"ÿ is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda like >> files into /tmp/RFS, basically into itself until it runs out of free space.


    I remember, a number of years ago, getting caught by exactly this, I believe on an earlier version of Debian.

    Considering that things might have changed since then, I tried it, with the following results:

    root@dyson:~# mkdir /mnt/test
    root@dyson:~# cp /dev/sda1 /mnt/test
    root@dyson:~# du /mnt/test
    173870 /mnt/test
    root@dyson:~# ll /mnt/test
    total 173861
    -rw-r----- 1 root root 535822336 Jan 24 18:22 sda1
    root@dyson:~# ll /mnt/test/sda1
    -rw-r----- 1 root root 535822336 Jan 24 18:22 /mnt/test/sda1

    #(/dev/sda contains /boot from a presently inactive Debian installation)# root@dyson:~# ll /dev/sda*
    brw-rw---- 1 root disk 8, 0 Jan 23 18:00 /dev/sda
    brw-rw---- 1 root disk 8, 1 Jan 23 18:00 /dev/sda1
    brw-rw---- 1 root disk 8, 2 Jan 23 18:00 /dev/sda2
    brw-rw---- 1 root disk 8, 3 Jan 23 18:00 /dev/sda3
    brw-rw---- 1 root disk 8, 4 Jan 23 18:00 /dev/sda4
    root@dyson:~# fdisk -l /dev/sda
    Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
    Disk model: SAMSUNG MZ7PD256
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: F6190B20-EBBF-420E-BF13-1F526D8C3F0B

    Device Start End Sectors Size Type
    /dev/sda1 2048 1048575 1046528 511M Linux filesystem
    /dev/sda2 1048576 458737663 457689088 218.2G Linux filesystem
    /dev/sda3 458737664 495908863 37171200 17.7G Microsoft basic data
    /dev/sda4 495908864 500101119 4192256 2G Microsoft basic data

    Having done that, I conclude that cp -r /dev/ probably would have done the same thing, and a lot more, just as my error of long ago.

    Interestingly, the resulting file, /mnt/test/sday can be mounted and looks entirely normal:
    root@dyson:~# mkdir /mnt2
    root@dyson:~# mount /mnt/test/sda1 /mnt2
    root@dyson:~# ll /mnt2
    total 122205
    -rw-r--r-- 1 root root 206212 Aug 7 2019 config-4.19.0-5-amd64
    -rw-r--r-- 1 root root 206361 Nov 10 2019 config-4.19.0-6-amd64
    drwxr-xr-x 5 root root 1024 Nov 14 2019 grub
    -rw-r--r-- 1 root root 53325177 Aug 10 2019 initrd.img-4.19.0-5-amd64 -rw-r--r-- 1 root root 54107425 Jan 9 2020 initrd.img-4.19.0-6-amd64 drwx------ 2 root root 12288 Jul 17 2014 lost+found
    -rw-r----- 1 root root 4096 Aug 27 2014 luks_head
    -rw-r--r-- 1 root root 3370904 Aug 7 2019 System.map-4.19.0-5-amd64 -rw-r--r-- 1 root root 3410671 Nov 10 2019 System.map-4.19.0-6-amd64 drwxr-xr-x 4 root root 1024 Mar 10 2020 'System Volume Information' -rw-r--r-- 1 root root 5217520 Aug 7 2019 vmlinuz-4.19.0-5-amd64
    -rw-r--r-- 1 root root 5270768 Nov 10 2019 vmlinuz-4.19.0-6-amd64

    As I also expected based on experience in the early 1990s when I used to make image backups of several systems by running gzip on the entire disk or on partitions of interest. And, of course, the reverse process is widely used, now, to plant .iso installer images to DVDs or USB keys.

    mount -bind /dev is the way I would do chroot setup, and I would expect nothing good from cp -r /dev

    Regards,
    Tom Dial



    A reasonable guess, but it's not correct.

    hobbit:~$ mkdir d1
    hobbit:~$ mkfifo d1/pipe
    hobbit:~$ cp -r d1 d2
    hobbit:~$ ls -l d1 d2
    d1:
    total 0
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    d2:
    total 0
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    =============================

    hobbit:~$ ls -l /dev/null
    crw-rw-rw- 1 root root 1, 3 Jan 14 18:21 /dev/null
    hobbit:~$ sudo mknod d1/null c 1 3
    [sudo] password for greg:
    hobbit:~$ sudo rm -rf d2
    hobbit:~$ sudo cp -r d1 d2
    hobbit:~$ ls -l d1 d2
    d1:
    total 0
    crw-r--r-- 1 root root 1, 3 Jan 24 09:27 null
    prw-rw-r-- 1 greg greg 0 Jan 24 09:25 pipe|

    d2:
    total 0
    crw-r--r-- 1 root root 1, 3 Jan 24 09:27 null
    prw-r--r-- 1 root root 0 Jan 24 09:27 pipe|

    =============================

    Of course, the bind mount solution is better than the cp solution in
    this case. But the cp solution isn't as wrong as you believed. One
    would probably want to use -a instead of -r, though, to copy the
    permissions and ownerships.

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From David Wright@3:633/10 to All on Sunday, January 25, 2026 04:40:01
    On Sat 24 Jan 2026 at 13:42:26 (-0700), D. R. Evans wrote:

    The documentation said:

    # Inspect the current prefix (and other preset variables):
    set
    # Find out which devices are available:
    ls
    # Set to the correct value, which might be something like this:
    set prefix=(hd0,1)/grub
    set root=(hd0,1)
    insmod normal
    normal

    Saying "set to the correct value, which might be something like" leaves me just shaking my head, and not having any idea what I'm actually supposed
    to type.

    If I try to boot from the RAID disk, which drops me into grub rescue, then type "ls", it responds with:
    (hd0) (fd0)

    If I type "set", it responds with:
    prefix='(hd0)/BOOT/debain@/grub'
    root='hd0'

    which is basically a pair of magic incantations to me.

    From my notes:

    set root=(disk?,part?)
    sets the partition that a filename starting with / will use.
    The superscripts give the lowest available number.

    set prefix=(disk,part)
    or
    set prefix=($root)/boot/grub
    specifies where Grub loads its modules from.

    The Grub rescue> prompt has only four commands: insmod ls set unset,
    so the aim is to find that $prefix directory, wherever it is.

    I don't remember whether you will have tab completion. Type:
    set root=(
    and press TAB to find out. Otherwise, you have to use ls at each step
    (dev by dev, dir by dir) until you find the grub directory.

    Once the prefix is set correctly, type:
    insmod normal
    and then:
    normal
    whereupon the rest of Grub's commands should work.

    Note that Grub's "root" has nothing to do with the root=UUID=1234?
    ??
    that's handed to the kernel for finding the root filesystem.

    When I used a couple of seemingly-well-regarded rescue disks that are sup
    posed
    to make this easy (supergrub2 and rescatux), before I posted the problem
    on
    the reflector, they both complained about unknown filesystems on the disk
    and
    wouldn't let me do anything useful. That was the point at which I knew I needed help.

    I have no experience with RAID. Perhaps there are other modules that
    need loading, like mdraid09, mdraid09_be and mdraid1x.mod (which happen
    to have 'raid' in their names). IDK, just guessing.

    Cheers,
    David.

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From tomas@3:633/10 to All on Sunday, January 25, 2026 09:50:01
    On Sat, Jan 24, 2026 at 07:01:00PM -0700, Tom Dial wrote:


    On 1/24/26 07:33, Greg Wooledge wrote:
    On Sat, Jan 24, 2026 at 16:09:12 +0500, Alexander V. Makartsev wrote:
    "cp -r /dev/ /tmp/RFS/dev/"ÿ is wrong! Don't do that.
    Think about it, "cp" command will copy block devices such as /dev/sda like
    files into /tmp/RFS, basically into itself until it runs out of free space.


    I remember, a number of years ago, getting caught by exactly this, I believe on an earlier version of Debian.

    Considering that things might have changed since then, I tried it, with the following results:

    root@dyson:~# mkdir /mnt/test
    root@dyson:~# cp /dev/sda1 /mnt/test
    root@dyson:~# du /mnt/test
    173870 /mnt/test
    root@dyson:~# ll /mnt/test
    total 173861
    -rw-r----- 1 root root 535822336 Jan 24 18:22 sda1
    root@dyson:~# ll /mnt/test/sda1
    -rw-r----- 1 root root 535822336 Jan 24 18:22 /mnt/test/sda1
    [...]
    This behaviour doesn't apply when -r option is given. Then, special
    files are copied as such *unless* you give option --copy-contents.
    It's all in the docs, but...
    tomas@caliban:~$ mkdir /tmp/foo
    tomas@caliban:~$ sudo cp -r /dev/sda1 /tmp/foo
    [sudo] password for tomas:
    tomas@caliban:~$ ls -al /tmp/foo
    total 20
    drwxr-xr-x 2 tomas tomas 4096 Jan 25 09:39 .
    drwxrwxrwt 9 root root 16384 Jan 25 09:39 ..
    brw-r----- 1 root root 8, 1 Jan 25 09:39 sda1
    The problem with -r is that it misses other (important) file attributes,
    as has been said elsewhere in this thread. Still, bind mount is the
    better option. Back then, long, long time ago, cp was the only available,
    so those recipes still float around in the intrawebs, like ghost ships.
    Harr!
    Cheers
    --
    t


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From alain williams@3:633/10 to All on Sunday, January 25, 2026 10:00:01
    On Sun, Jan 25, 2026 at 09:44:43AM +0100, tomas@tuxteam.de wrote:

    Back then, long, long time ago, cp was the only available, so those recipes still float around in the intrawebs, like ghost ships.

    Sorry: yes, I started using Unix in 1986 and still use old recipes.

    --
    Alain Williams
    Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
    +44 (0) 787 668 0256 https://www.phcomp.co.uk/
    Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
    #include <std_disclaimer.h>

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Alexander V. Makartsev@3:633/10 to All on Sunday, January 25, 2026 21:10:01
    On 1/25/26 02:26, D. R. Evans wrote:
    Alexander V. Makartsev wrote on 1/24/26 1:48 PM:

    It looks like these warnings appear when you try to install grub into
    disk which contains RAID array in a degraded state. [1]
    Try to boot from this disk now, if boot will be successful then you've
    done with grub and the next step is to replace missing drive and resync
    the array.


    OK, boot was NOT successful:

    Pity. This means something is wrong with the mdraid setup?
    I received the error message: disk mduuid<8d86...0aed> not found, and
    then it dropped me to the "grub rescue>" prompt.

    I expect that the named missing disk is the one that contained the
    running system (sdb) [which is a non-RAID disk, created just for the
    purpose of allowing me to boot and execute all these commands].

    However, I get the above message when I try to boot from the failed
    disk, regardless of whether the non-RAID disk is in the machine.
    Your case is interesting enough so I spun up a VM to try to reproduce
    the problem you have.
    However, my VM boots normally, after a slight delay, with one disk
    removed and with MD RAID1 arrays in a clean, degraded state.
    There wasn't "grub rescue>" prompt at any point, it just works.
    Still, a quick search on the internet shows that there were others who
    had, at some point, similar problems with MD arrays and Grub.
    Experiments with VM shows that Grub stage 1 bootloader is capable enough
    to identify a MD array, "mount" it for itself, get into ext4 filesystem
    on that array to access its modules inside /boot/grub/i386-pc directory
    and its /boot/grub/grub.cfg config file.
    I suspect your MD RAID1 was probably setup is a non-standard way,
    somehow, so grub gets confused during system startup, or during "grub-install".
    The whole procedure with chroot and "grub-install", as my tests show, regenerates all necessary grub modules inside "/boot" and creates valid
    grub config with all UUIDs necessary for system to startup.
    My first guess is that you are using that non-RAID disk which somehow
    still contains MD array metadata on it.
    Maybe all this time we were recovering wrong disk? Is it possible that
    sda and sdb devices were mixed up during boot time? I'm really grasping
    at straws.
    So my first suggestion is to make a bootable USB thumb drive with Live
    system on it, to exclude possible interference with other disks.
    I also need output from these commands, to see how your MD arrays were
    setup, their current states, disk partition table, UUIDs, etc:
    ? ? blkid
    ? ? ls /dev/md*? ? #Asterisk here because when I setup MD RAID with
    Debian installer, arrays were named md0 and md1. First is swap and
    second is root.
    ? ? cat /proc/mdstat
    ? ? mdadm --detail /dev/md*
    ? ? fdisk -x
    ? ? cat /etc/fstab? ? #After chroot ofcourse
    ? ? cat /boot/grub/grub.cfg | grep -iE -- "--set=root|root=|insmod"? ?
    #After chroot ofcourse
    You can upload it all to paste service and send just the link: https://paste.debian.net/
    I know it is a lot, but it is hard to suggest anything useful without
    seeing the whole picture.
    Maybe your experiments with "grub rescue>" will be useful and reveal
    more information.

    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Eddie@3:633/10 to All on Monday, January 26, 2026 18:40:02


    On 1/26/26 11:46 AM, D. R. Evans wrote:
    D. R. Evans wrote on 1/24/26 2:26 PM:
    Alexander V. Makartsev wrote on 1/24/26 1:48 PM:

    It looks like these warnings appear when you try to install grub into
    disk which contains RAID array in a degraded state. [1]
    Try to boot from this disk now, if boot will be successful then you've
    done with grub and the next step is to replace missing drive and resync
    the array.


    OK, boot was NOT successful:

    I received the error message: disk mduuid<8d86...0aed> not found, and
    then it
    dropped me to the "grub rescue>" prompt.

    Alexander V. Makartsev wrote:


    My first guess is that you are using that non-RAID disk which somehow
    still contains MD array metadata on it. Maybe all this time we were
    recovering wrong disk? Is it possible that sda and sdb devices were
    mixed
    up during boot time?


    D. R. Evans wrote:

    Nope, definitely not. I am very careful, each time I boot, to make
    sure which
    disk is which, because I am aware that the mapping between device name
    and
    physical drive can and does change, and one needs to be very, very
    careful
    when issuing commands that they are going to affect the correct disk.

    I had just a few minutes, and thought it would be worthwhile to quickly check this by going through the entire procedure to write the MBR again, very carefully (hoping that somehow I had made a mistake the first time)
    -- but the result is exactly the same: the RAID disk doesn't boot, with
    the same error message.

    I just wanted to confirm to you that the failure doesn't seem to be
    caused by my skipping a step or mistyping something or confusing which
    disk is which.

    I have to go and do other stuff now for at least several hours, but will
    try to get back to working on the problem later today.

    ÿ Doc


    I have used the "boot-repair" iso on a "ventoy" usb bootable to repair
    several grub problems. This software has a function to identify the
    problem without any changes being made and may identify what the
    difficulty is.

    Eddie

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Alexander V. Makartsev@3:633/10 to All on Wednesday, January 28, 2026 19:00:01
    On 1/28/26 02:32, D. R. Evans wrote:
    ...
    It turns out that the BIOS on the computer doesn't seem to provide any
    way to boot from USB. The best I can do, as far as I can tell, is to
    create a live DVD and boot from that.

    So I have booted from a live CD (which is very slow, but does
    eventually succeed), and made sure that the only hard drive in the
    machine is the RAID device that I am trying to fix.

    That is strange, how old is your hardware? When you mentioned 2013 I was thinking 4th gen Intel CPU and Haswell-era hardware, which should
    support USB-boot.
    What's model and make of your motherboard?
    This could be another clue, because we are dealing with an old BIOS, MBR partition table, which has 2TB boundary limit and 3TB disk.
    After looking at the output you sent so far, it is possible that grub
    has nothing to do with the problems you have.
    Grub seems to identify every piece of the puzzle correctly and loads all necessary modules from its core image to do that.
    It is starting to look a lot like a hardware incompatibility between old
    BIOS, ICH, MBR and 3TB Disk with advanced format.
    Can you test this theory by trying to boot from this disk using another possibly newer motherboard?
    ...
    _Exactly_ what chroot command do you want me to type at this point?

    I am sorry I wasn't more clear. What I meant to say is that you have to
    get the output data from the OS you trying to rescue, not the host OS.
    In other words, after you change root "/etc/fstab" will point to fstab
    on the RAID disk you trying to rescue, and if you don't it will point to
    fstab of the host system on non-RAID disk.
    So "to chroot" means the same sequence of commands as before, but
    without grub-install:
    ? ? mkdir /tmp/RFS
    ? ? mount?/dev/md126?/tmp/RFS? ? #Mount root filesystem
    ? ? mount --bind /dev /tmp/RFS/dev? ? #Mount bind real /dev to populate chroot-ed /dev
    ? ? mount --bind /proc /tmp/RFS/proc? ? #Mount bind real /proc to
    populate chroot-ed /proc
    ? ? mount --bind /sys /tmp/RFS/sys? ? #Mount bind real /systo populate chroot-ed /sys
    ? ? chroot /tmp/RFS /usr/bin/bash? ? #Change root into directory /tmp/RFS
    Now you can issue those commands and get output:
    ? ? cat /etc/fstab
    ? ? cat /boot/grub/grub.cfg | grep -iE -- "--set=root|root=|insmod"
    At this point, you can also enable debug mode to maybe get some more information from grub at boot time:
    ? ? grub-editenv - set pager=1
    ? ? grub-editenv - set debug='kern init modules device disk drive drivemap'
    It could be helpful to regenerate initramfs and reinstall grub once again:
    ? ? update-initramfs -c -k all
    ? ? dpkg-reconfigure grub-pc? ? #Install grub to /dev/sda only, of
    course after checking that /dev/sda is the 3TB disk you want to rescue. "dpkg-reconfigure grub-pc" will complain about missing disks on the
    arrays, but will complete the install. I've tested it on the VM and boot
    was successful.
    To exit chroot and disassemble it:
    ? ? exit? ? #Exit chroot
    ? ? umount /tmp/RFS/dev
    ? ? umount /tmp/RFS/proc
    ? ? umount /tmp/RFS/sys
    ? ? umount /tmp/RFS
    ...
    That's the next thing to try to do, now that I have Internet access
    back so that I can download and study the documents.
    Just some ideas, there are more options to try, but they are extremely
    risky and complicated, so if you want to try any of them, you have to
    make reliable backups of your data first.
    I am thinking about removing completely dead array on /dev/sda1, and
    repurpose /dev/sda1 to make it a simple 16GB volume with ext3 filesystem
    and move "/boot" to it.
    I'm calling md127 array on /dev/sda1 dead, because apparently md127 only
    has one drive assigned to it and that drive is assigned as spare, so
    that array has no data at all.
    Maybe dead array somehow confuses grub and its mdraid1x module during
    boot time and its removal will fix the problem.
    Another option to try is to use an old disk of smaller size, 180GB or
    250GB if you have it, and use it just to boot the system and this way
    defeat possible hardware incompatibility with BIOS and MBR.
    Or you could try to convert MBR partition table to GPT partition table
    to possibly improve compatibility with grub and 3TB disk, but there
    could be some compatibility problems with an old BIOS and GPT.
    Maybe it will be better to reinstall OS on another disk, with GPT
    partition table (if the new disk will be larger than 2TB) and migrate
    the data from 3TB disk.
    None of these are simple tasks and they are very difficult to do over
    email...

    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Alexander V. Makartsev@3:633/10 to All on Thursday, January 29, 2026 12:40:01
    On 1/29/26 02:03, D. R. Evans wrote:
    Alexander V. Makartsev wrote on 1/28/26 10:55 AM:
    That is strange, how old is your hardware? When you mentioned 2013 I was
    thinking 4th gen Intel CPU and Haswell-era hardware, which should
    support USB-boot.

    OK... on the basis of the fact that you expected USB boot to work, I
    just went and spent some time messing with the boot options, and found
    a way to make it work. What I had not realised was that it was not
    enough to select "USB-HDD" from the BIOS list, but I also had to then
    go and look at the hard drive boot order, where a new entry had
    appeared (at a low priority). Once I saw that and changed its priority
    so that it was the preferred boot device, the machine booted fine from
    the USB drive.

    All this, I'm sure, is very elementary stuff... but if one has never encountered it before, as I have not, none of it was obvious.

    So the next bit of your e-mail (about the motherboard and booting) no
    longer applies.
    I think it does.
    Because with the last bits of information I can tell there is nothing
    wrong with grub config file and OS config files (you did
    "update-initramfs" and "dpkg-reconfigure" from previous email right?).
    All partition\array UUIDs are detected by grub, they all match and at
    their places across many config files and during boot time.
    Your MD RAID1 setup is extremely ordinary, it should work without any
    hickups, but it doesn't.
    Except maybe weirdly configured and inactive array /dev/md127 on
    /dev/sda1 which meant to be used as swap.
    So, I'd continue by fixing it.
    I still want to know the details about your motherboard. Maybe there is
    a BIOS update, or this is known issue with larger AF disks and MBR style partition table, you never know.
    Everything I've suggested so far is something I would try myself, if I
    had the same problem and conditions as you have.
    ...
    I'll pause there, so you have a chance to look at that, and I have a
    chance to look at the grub rescue stuff ... and also try put out
    another (unrelated) urgent fire.
    I imagine you could type at grub rescue prompt something like this:
    grub> set pager=1
    grub> insmod normal
    grub> insmod part_msdos
    grub> insmod diskfilter
    grub> insmod mdraid1x
    grub> insmod ext2
    grub> ls
    (proc) (hd0) (hd0,msdos1) (hd0,msdos2) (md/0)
    grub> set prefix=(md/0)/boot/grub
    grub> set root=(md/0)
    grub> linux ($root)/boot/vmlinuz-6.12.63+deb13-amd64 root=/dev/md126
    grub> initrd ($root)/boot/initrd.img-6.12.63+deb13-amd64
    grub> boot
    Note: your md devices could be named differently there, maybe not
    "(md/0)" and "root=/dev/md126", because one of your raid1 arrays is not functioning.
    And you don't need to type "grub>", obviously..
    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bigsy Bohr@3:633/10 to All on Thursday, January 29, 2026 17:50:01
    On 2026-01-28, D. R. Evans <doc.evans@gmail.com> wrote:

    OK... on the basis of the fact that you expected USB boot to work, I just went
    and spent some time messing with the boot options, and found a way to make it
    work. What I had not realised was that it was not enough to select "USB-HDD" from the BIOS list, but I also had to then go and look at the hard drive boot
    order, where a new entry had appeared (at a low priority). Once I saw that and
    changed its priority so that it was the preferred boot device, the machine booted fine from the USB drive.

    All this, I'm sure, is very elementary stuff... but if one has never encountered it before, as I have not, none of it was obvious.

    In fact, that's not my experience with an old and buggy BIOS. There's a preferred boot order; it looks first for a hard disk, then for an optical device, failing that a USB dongle, etc. That order can be altered, which
    is logical.

    But whatever works, as the saying goes.

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Alexander V. Makartsev@3:633/10 to All on Thursday, January 29, 2026 18:20:01
    On 1/29/26 21:31, David Wright wrote:
    ...
    Before moving on from the "ls" step, the OP needs to see some
    output that ends in /grub, at least resembling:

    Grub> ls (hdX,msdosY)/boot/
    \u2026 \u2026 \u2026 \u2026 \u2026 \u2026 grub/ \u2026 \u2026 \u2026 \u2026 \u2026
    Grub> ls (hdX,msdosY)/boot/grub/
    \u2026 a list of Grub directories Grub> \u2026 \u2026 grub.cfg \u2026 \u2026

    at which point, these commands should work:

    Grub> set prefix=(hdX,msdosY)/boot/grub
    Grub> set root=hdX,msdosY
    Grub> insmod normal
    Grub> normal

    giving access to all of Grub's commands.
    His prefix "/boot/grub" and "/" is inside md array, so <TAB>-asking
    existing device (hdX,msdosY) will return nothing.
    Instead, (md/0) <TAB> should show "/boot"
    I'm confident those commands (some of them are redundant) I typed will
    boot OS with his storage configuration from a grub command line.
    There is even no apparent reason for boot process to go through grub
    rescue in a first place.

    --
    With kindest regards, Alexander.
    Debian - The universal operating system
    https://www.debian.org


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bigsy Bohr@3:633/10 to All on Friday, January 30, 2026 14:30:01
    On 2026-01-30, David Wright <deblis@lionunicorn.co.uk> wrote:
    On Thu 29 Jan 2026 at 16:46:40 (-0000), Bigsy Bohr wrote:
    On 2026-01-28, D. R. Evans <doc.evans@gmail.com> wrote:

    OK... on the basis of the fact that you expected USB boot to work, I just went
    and spent some time messing with the boot options, and found a way to make it
    work. What I had not realised was that it was not enough to select "USB-HDD"
    from the BIOS list, but I also had to then go and look at the hard drive boot
    order, where a new entry had appeared (at a low priority). Once I saw that and
    changed its priority so that it was the preferred boot device, the machine
    booted fine from the USB drive.

    All this, I'm sure, is very elementary stuff... but if one has never
    encountered it before, as I have not, none of it was obvious.

    In fact, that's not my experience with an old and buggy BIOS. There's a
    preferred boot order; it looks first for a hard disk, then for an optical
    device, failing that a USB dongle, etc. That order can be altered, which
    is logical.

    Your experience relates to BIOSes similar to those in standard Intel
    desktop mobos (like Rhinestone/Endeavour/Atlanta/Tucson/Seattle)
    that I've used in the past, or all the Dells I've used since:
    a neat list of potential targets, in order, and even telling you
    nowadays which are present and which not.

    But the OP's priority-promotion behaviour is quite normal for, say,
    a PhoenixBIOS. It's just a shame that the OP hadn't discovered that
    when the machine was first obtained (and could be expected to work
    to spec or have a manual, or whatever).

    With the PhoenixBIOS in particular, there are other undocumented
    wrinkles too. Any indication that the machine /can/ boot from USB
    depends on your having inserted a stick before you turn it on.
    IOW you can navigate all around the BIOS menus with no whisper
    of the term USB.

    Worse, the same is true if you boot /with/ a USB stick inserted. You
    have to /know/ to navigate to Hard Drive and press Enter in order to
    see the first mention of "USB".

    Worse still, you get false negatives: not every USB stick will work
    from a stack of sticks, even when identical images are installed on
    them all. And those that work may not work in every USB socket?
    particularly on laptops, where they're scattered about the mobo
    and might have different specs.

    Any lack of success (bad stick or absence) will reset the BIOS,
    erasing any trace in the BIOS that USB booting had been possible.

    All of the above can be demonstrated by my Acer Travelmate 3201xci.

    You're an excellent trouble-shooter. I have an Acer X1301 with a kind of
    ACPI bug in it (sometimes when my Samsung SyncMaster 172v goes into power-saving mode, it turns the screen off completely, and I have to
    unplug it for a minute or two and then plug it back in). It took me a
    while to grok that it wasn't the monitor itself that was failing.

    And sometimes when powering off, the mobo doesn't turn off (although the shutdown routine has been correctly performed, and there's no recuperation of the journal when booting again), and I have to press the power button for
    five seconds to turn the machine off.

    This Acer is still running, though. It's only the third computer I've
    ever owned; the second is at my feet, and the first was a Dell that
    suffered from the "bad caps" syndrome at the turn of the century.


    Cheers,
    David.



    --- PyGate Linux v1.5.8
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)