Problem with setup-storage

Rémy Dernat remy.d1 at gmail.com
Wed Feb 7 09:46:02 CET 2024


Hi,

I don't know if this is really related, but as I also said on IRC,
`checkdisk` returns an empty string. All the functions depending on it
are also returning an empty string. I tried to modify it manually in
subroutines with the following content, but it did not help either:

```bash
checkdisk() {

    # read lines with device name and size and check if device is a disk
    # $1 can be a device name that will be ignored. Used for the device
    # name of the USB stick if we boot from it
    local igndev=('loop') #devices to ignore
    igndev+=($1)
    local isdisk
    ls /dev | while read device blocks; do
        isdisk=1
        # old way of detecting disks: [ $(cat
/sys/block/$device/removable) -eq 1 ] && isdisk=0
        [ $(stat -c %G /dev/$device) = "disk" ] || isdisk=0

        # if set, ignore these devices
        [[ "${igndev[@]}" =~ ${device}* ]] && isdisk=0
        if [ $isdisk -eq 1 ]; then
            echo "$device"
        fi
    done
}
```

here is the content of `fai-disk-info`:

```bash
#! /bin/bash

set_bootstick
all_disks_and_size | checkdisk $FAI_BOOTSTICK | once_only
```

That is really odd, because when I checked that modified version of
`checkdisk` locally, it works on my local machine. Moreover, I am able
to see disk devices in /dev when dracut spawn a shell terminal. I
don't know why it does not work in the dracut chroot mounted space
system; maybe a `sh` vs a `bash` issue although the subroutine calls
directly `/bin/bash` .. O_o ... All files in /usr/lib/fai/ are set in
755 mode, with owner and group root.

I am currently stuck with some machines unable to install because of
this issue...

Best regards,
Rémy

Le mar. 6 févr. 2024 à 15:59, Stephen Quinney via linux-fai
<linux-fai at uni-koeln.de> a écrit :
>
> Diese Nachricht wurde eingewickelt um DMARC-kompatibel zu sein. Die
> eigentliche Nachricht steht dadurch in einem Anhang.
>
> This message was wrapped to be DMARC compliant. The actual message
> text is therefore in an attachment.
>
>
> ---------- Forwarded message ----------
> From: Stephen Quinney <squinney at inf.ed.ac.uk>
> To: linux-fai <linux-fai at uni-koeln.de>
> Cc:
> Bcc:
> Date: Tue, 6 Feb 2024 14:59:08 +0000
> Subject: Problem with setup-storage
> I'm using the packages from Debian unstable so I reported this to the
> Debian bug tracker first but then thought that it might be better done
> through the mailing list.
>
> We use the setup-storage utility in a standalone manner in our local
> installation and configuration scripts with the rest of FAI. Up until
> 6.2 this worked just fine but now it fails.
>
> This seems to be related to changes in the fai-disk-info script.
>
> With 6.0 I get:
>
> /usr/lib/fai/fai-disk-info
> sda
>
> and with 6.2 I now get:
>
> /usr/lib/fai/fai-disk-info
> bash: set_bootstick: command not found
> bash: once_only: command not found
> bash: all_disks_and_size: command not found
> bash: checkdisk: command not found
>
> At first I thought it was down to not having the fai-client package
> installed (it's not listed as a dependency for fai-setup-storage)
> since it provides the /usr/lib/fai/subroutines. However, installing
> that package hasn't helped.
>
> Any help would be appreciated.
>
> Regards,
>
> Stephen Quinney


More information about the linux-fai mailing list