USB PendriveのGRUBカスタム項目の解決方法

USB PendriveのGRUBカスタム項目の解決方法

USB PendriveにPorteusをインストールし、3つのパーティションに分けました。最初のパーティションはexFAT(以前のWindowsとの互換性のため)で、2番目のパーティションはブートパーティションなのでext2にあり、3番目のパーティションには次のものが含まれています。 Porteus ISOとデータフォルダ。

他の投稿を見ることができます - >https://forum.porteus.org/viewtopic.php?f=140&t=10878&p=94752#p94752

まあ、問題は私のgrub.confにあります。このソリューションを入れました。

    if [ "$root" == "hd0,msdos2" ]; then unset root ; root="sda2" ; fi
    if [ "$root" == "hd0,msdos3" ]; then unset root ; root="sda3" ; fi
    if [ "$root" == "hd0,msdos4" ]; then unset root ; root="sda4" ; fi
    if [ "$root" == "hd0,msdos5" ]; then unset root ; root="sda5" ; fi
    if [ "$root" == "hd0,msdos6" ]; then unset root ; root="sda6" ; fi
    if [ "$root" == "hd0,msdos7" ]; then unset root ; root="sda7" ; fi
    if [ "$root" == "hd0,msdos8" ]; then unset root ; root="sda8" ; fi
    if [ "$root" == "hd0,msdos9" ]; then unset root ; root="sda9" ; fi
    if [ "$root" == "hd1,msdos1" ]; then unset root ; root="sdb1" ; fi
    if [ "$root" == "hd1,msdos2" ]; then unset root ; root="sdb2" ; fi
    if [ "$root" == "hd1,msdos3" ]; then unset root ; root="sdb3" ; fi
    if [ "$root" == "hd1,msdos4" ]; then unset root ; root="sdb4" ; fi
    if [ "$root" == "hd1,msdos5" ]; then unset root ; root="sdb5" ; fi
    if [ "$root" == "hd1,msdos6" ]; then unset root ; root="sdb6" ; fi
    if [ "$root" == "hd1,msdos7" ]; then unset root ; root="sdb7" ; fi
    if [ "$root" == "hd1,msdos8" ]; then unset root ; root="sdb8" ; fi
    if [ "$root" == "hd1,msdos9" ]; then unset root ; root="sdb9" ; fi
    if [ "$root" == "hd2,msdos1" ]; then unset root ; root="sdc1" ; fi
    if [ "$root" == "hd2,msdos2" ]; then unset root ; root="sdc2" ; fi
    if [ "$root" == "hd2,msdos3" ]; then unset root ; root="sdc3" ; fi
    if [ "$root" == "hd2,msdos4" ]; then unset root ; root="sdc4" ; fi
    if [ "$root" == "hd2,msdos5" ]; then unset root ; root="sdc5" ; fi
    if [ "$root" == "hd2,msdos6" ]; then unset root ; root="sdc6" ; fi
    if [ "$root" == "hd2,msdos7" ]; then unset root ; root="sdc7" ; fi
    if [ "$root" == "hd2,msdos8" ]; then unset root ; root="sdc8" ; fi
    if [ "$root" == "hd2,msdos9" ]; then unset root ; root="sdc9" ; fi
    if [ "$root" == "hd3,msdos1" ]; then unset root ; root="sdd1" ; fi
    if [ "$root" == "hd3,msdos2" ]; then unset root ; root="sdd2" ; fi
    if [ "$root" == "hd3,msdos3" ]; then unset root ; root="sdd3" ; fi
    if [ "$root" == "hd3,msdos4" ]; then unset root ; root="sdd4" ; fi
    if [ "$root" == "hd3,msdos5" ]; then unset root ; root="sdd5" ; fi
    if [ "$root" == "hd3,msdos6" ]; then unset root ; root="sdd6" ; fi
    if [ "$root" == "hd3,msdos7" ]; then unset root ; root="sdd7" ; fi
    if [ "$root" == "hd3,msdos8" ]; then unset root ; root="sdd8" ; fi
    if [ "$root" == "hd3,msdos9" ]; then unset root ; root="sdd9" ; fi
    if [ "$root" == "hd4,msdos1" ]; then unset root ; root="sde1" ; fi
    if [ "$root" == "hd4,msdos2" ]; then unset root ; root="sde2" ; fi
    if [ "$root" == "hd4,msdos3" ]; then unset root ; root="sde3" ; fi
    if [ "$root" == "hd4,msdos4" ]; then unset root ; root="sde4" ; fi
    if [ "$root" == "hd4,msdos5" ]; then unset root ; root="sde5" ; fi
    if [ "$root" == "hd4,msdos6" ]; then unset root ; root="sde6" ; fi
    if [ "$root" == "hd4,msdos7" ]; then unset root ; root="sde7" ; fi
    if [ "$root" == "hd4,msdos8" ]; then unset root ; root="sde8" ; fi
    if [ "$root" == "hd4,msdos9" ]; then unset root ; root="sde9" ; fi
    if [ "$root" == "hd5,msdos1" ]; then unset root ; root="sdf1" ; fi
    if [ "$root" == "hd5,msdos2" ]; then unset root ; root="sdf2" ; fi
    if [ "$root" == "hd5,msdos3" ]; then unset root ; root="sdf3" ; fi
    if [ "$root" == "hd5,msdos4" ]; then unset root ; root="sdf4" ; fi
    if [ "$root" == "hd5,msdos5" ]; then unset root ; root="sdf5" ; fi
    if [ "$root" == "hd5,msdos6" ]; then unset root ; root="sdf6" ; fi
    if [ "$root" == "hd5,msdos7" ]; then unset root ; root="sdf7" ; fi
    if [ "$root" == "hd5,msdos8" ]; then unset root ; root="sdf8" ; fi
    if [ "$root" == "hd5,msdos9" ]; then unset root ; root="sdf9" ; fi
    if [ "$root" == "hd6,msdos1" ]; then unset root ; root="sdg1" ; fi
    if [ "$root" == "hd6,msdos2" ]; then unset root ; root="sdg2" ; fi
    if [ "$root" == "hd6,msdos3" ]; then unset root ; root="sdg3" ; fi
    if [ "$root" == "hd6,msdos4" ]; then unset root ; root="sdg4" ; fi
    if [ "$root" == "hd6,msdos5" ]; then unset root ; root="sdg5" ; fi
    if [ "$root" == "hd6,msdos6" ]; then unset root ; root="sdg6" ; fi
    if [ "$root" == "hd6,msdos7" ]; then unset root ; root="sdg7" ; fi
    if [ "$root" == "hd6,msdos8" ]; then unset root ; root="sdg8" ; fi
    if [ "$root" == "hd6,msdos9" ]; then unset root ; root="sdg9" ; fi
    if [ "$root" == "hd7,msdos1" ]; then unset root ; root="sdh1" ; fi
    if [ "$root" == "hd7,msdos2" ]; then unset root ; root="sdh2" ; fi
    if [ "$root" == "hd7,msdos3" ]; then unset root ; root="sdh3" ; fi
    if [ "$root" == "hd7,msdos4" ]; then unset root ; root="sdh4" ; fi
    if [ "$root" == "hd7,msdos5" ]; then unset root ; root="sdh5" ; fi
    if [ "$root" == "hd7,msdos6" ]; then unset root ; root="sdh6" ; fi
    if [ "$root" == "hd7,msdos7" ]; then unset root ; root="sdh7" ; fi
    if [ "$root" == "hd7,msdos8" ]; then unset root ; root="sdh8" ; fi
    if [ "$root" == "hd7,msdos9" ]; then unset root ; root="sdh9" ; fi
    if [ "$root" == "hd8,msdos1" ]; then unset root ; root="sdi1" ; fi
    if [ "$root" == "hd8,msdos2" ]; then unset root ; root="sdi2" ; fi
    if [ "$root" == "hd8,msdos3" ]; then unset root ; root="sdi3" ; fi
    if [ "$root" == "hd8,msdos4" ]; then unset root ; root="sdi4" ; fi
    if [ "$root" == "hd8,msdos5" ]; then unset root ; root="sdi5" ; fi
    if [ "$root" == "hd8,msdos6" ]; then unset root ; root="sdi6" ; fi
    if [ "$root" == "hd8,msdos7" ]; then unset root ; root="sdi7" ; fi
    if [ "$root" == "hd8,msdos8" ]; then unset root ; root="sdi8" ; fi
    if [ "$root" == "hd8,msdos9" ]; then unset root ; root="sdi9" ; fi
    if [ "$root" == "hd9,msdos1" ]; then unset root ; root="sdj1" ; fi
    if [ "$root" == "hd9,msdos2" ]; then unset root ; root="sdj2" ; fi
    if [ "$root" == "hd9,msdos3" ]; then unset root ; root="sdj3" ; fi
    if [ "$root" == "hd9,msdos4" ]; then unset root ; root="sdj4" ; fi
    if [ "$root" == "hd9,msdos5" ]; then unset root ; root="sdj5" ; fi
    if [ "$root" == "hd9,msdos6" ]; then unset root ; root="sdj6" ; fi
    if [ "$root" == "hd9,msdos7" ]; then unset root ; root="sdj7" ; fi
    if [ "$root" == "hd9,msdos8" ]; then unset root ; root="sdj8" ; fi
    if [ "$root" == "hd9,msdos9" ]; then unset root ; root="sdj9" ; fi

ループ、配列などを使用するなど、 grub でこの回避策が短くなる可能性があるかどうか教えてください。

Linuxが使用したhd "番号"(番号は0 = a、1 = b、2 = c、...などの文字に変更する必要があります)の場合、msdos "番号"番号は変更されませんでした。この移行では、「msdos」という単語は再び表示されないでください。

私はgrubがbashと互換性があることを望みます(しかし、より少ない数のコマンドで)。ほんの数行でこれを行う方法を知っている人はいますか?私は行ごとにほぼ同じものを繰り返すのが本当に好きではありません。

ベストアンサー1

おすすめ記事