seduction
 Language:
Welcome, Guest. Please login or register.
Did you miss your activation email?
2019/10/14, 07:34:18


Help

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: (solved) grub2, howto boot a copied partition (for d-u experiments)  (Read 2812 times)

0 Members and 1 Guest are viewing this topic.

Offline michaa7

  • User
  • Posts: 2.126
My default installation is on sdb1. That's the one for daily use and the one I am working on now.

I copied this installation while my system was booted from an Xorg installation on an usb-stick. I copied this installation using "cp -a /mnt/sdb1/. /mnt/sdc1" which worked as usual. Then I edited the entry for the new system partition in /mnt/sdc1/etc/fstab.

I am aware that I still have to configure (?) and update grub2, but I am still confused where from I have to do it with a copied partition.

So here is what happened:
While the system was booted from USB-stick I did neither reconfigure grub nor did I update grub.
I booted my default system (sdb1) and run "update-grub" which did find the system on /dev/sdc1 and created the respective entry.

But now, when I select this sdc1 entry during the boot process the mount command shows that acctually sdb1 has been booted.

So how do I tell grub to really boot from sdc1 using the sdc1 entry? I want to update/install grub2 while my default system on sdb1 is booted.

I really would like to give this experimental installation a better suited menuentry like "siduction_experimental". Is /etc/grub.d/40_custom on sdc1 usefull for this purpose?

Thanks.

 



« Last Edit: 2015/09/07, 19:59:35 by michaa7 »
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline melmarker

  • Global Moderator
  • User
  • *****
  • Posts: 2.755
    • g-com.eu
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #1 on: 2015/09/06, 15:36:28 »
hi michaa7,

never use 40_* or 41_* directly, copy it to another name - depending on where in the list the entry should appear - i would suggest 11_playground or so. another remark - you don't really want to use physical devices or partitions - use the UUID or a label. Last but not least, point to the links for image and initrd in target-root, doing so you are done with grub configurations after kernel upgrades.
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. (Benjamin Franklin, November 11, 1755)
Never attribute to malice that which can be adequately explained by stupidity. (Hanlons razor)

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #2 on: 2015/09/06, 16:27:07 »


never use 40_* or 41_* directly,

understood, will do.
Quote
copy it to another name - depending on where in the list the entry should appear - i would suggest 11_playground

sounds ok, will do.

 
Quote
or so. another remark - you don't really want to use physical devices or partitions

I do *not*, since years

Quote
- use the UUID or a label.

I do, since years. But unfortunatly LABEL doesn't seem to work reliably, UUID does.

Quote
Last but not least, point to the links for image and initrd in target-root,

Where? In which file on which partition? (sdb1 is default, sdc1 the copied partition which does not boot)
And how?
And afterwards, update-grub issued from sdb1 will read it?

Quote
doing so you are done with grub configurations after kernel upgrades.

Yes, I know.


A remark of which I don't know whether or not it is related. During boot of my default partition I allways get a warning telling me that the path to UUID=<x-x-x-x> is the wrong or unresolvable path (or something like this). Which is weird, because it is the UUID of the system partition which is booted without problems. This is nothing new but a many month old issue.
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline der_bud

  • User
  • Posts: 887
  • member
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #3 on: 2015/09/06, 16:28:05 »
Not really sure if I am right at that, but when you copied "cp -a /mnt/sdb1/. /mnt/sdc1", then you copied the /boot/grub.grub.cfg as well. That has lines with entries for setting root, probably still pointing to your sdb. With update-grub, I think the updater sees a valid grub on sdc, makes an entry, but selecting that boots the .cfg that sets sdb as root. I think you need to chroot into that sdc1-system (explained in manual) and reinstall grub from within the chroot  (or perhaps update-grub inside the chroot is enough ????)
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #4 on: 2015/09/06, 16:34:52 »
Not really sure if I am right at that, but when you copied "cp -a /mnt/sdb1/. /mnt/sdc1", then you copied the /boot/grub.grub.cfg as well. That has lines with entries for setting root, probably still pointing to your sdb.

Yes, that's what I'm struggling with. With grub-legacy, we directly could edit grub to point to the right boot partition. This is what I don't get with grub2, how to change the boot device after copying a system.

Quote
With update-grub, I think the updater sees a valid grub on sdc, makes an entry, but selecting that boots the .cfg that sets sdb as root. I think you need to chroot into that sdc1-system (explained in manual) and reinstall grub from within the chroot  (or perhaps update-grub inside the chroot is enough ????)

yeah, that sound reasonable, and I think that's how I did it in the past, but forgot about it. But I need to install grub to partiton, right? And if there is a reference to some boot device in the initrd, then melmaker is right too.  Now I am really confused.
« Last Edit: 2015/09/06, 16:39:25 by michaa7 »
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline der_bud

  • User
  • Posts: 887
  • member
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #5 on: 2015/09/06, 16:48:56 »
Just thinking if melmakers version with 40-custom would be the better solution than chrooting. To do so, first copy 40-custom to 11-playground (or whatever). Than copy a working menuentry from your current grub.cfg into it (starting from menuentry 'siduction... to the matching } ).
Edit that entry to have a descriptive menuentry and carefully seek for root=UUID or labels or devicenames to point to sdc1.
For the kernel-line, there should be links in your root / to /boot, I have
Code: [Select]
lrwxrwxrwx   1 root root    45 Aug 15 17:40 initrd.img -> /boot/initrd.img-4.1.5-towo.1-siduction-amd64
lrwxrwxrwx   1 root root    45 Jul 26 15:35 initrd.img.old -> /boot/initrd.img-4.1.3-towo.1-siduction-amd64
lrwxrwxrwx   1 root root    41 Aug 15 17:40 vmlinuz -> boot/vmlinuz-4.1.5-towo.1-siduction-amd64
lrwxrwxrwx   1 root root    41 Jul 26 15:35 vmlinuz.old -> boot/vmlinuz-4.1.3-towo.1-siduction-amd64

So instead the full /boot/$kernelname or $imagename you can change that to /initrd.img and /vmlinuz  to always boot the latest kernel in that system (the .old entries are the kernel before)

A last update-grub will write the content from 11-playground to your grub...
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline melmarker

  • Global Moderator
  • User
  • *****
  • Posts: 2.755
    • g-com.eu
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #6 on: 2015/09/06, 16:51:44 »
erm - mal in deutsch, bevor ich Mist schreib - grub ist nur der eine Punkt:
image und vmlinz in root benutzen, das wird vom apt bei neuen images und initrds umgesetzt
Code: [Select]
  38644 lrwxrwxrwx   1 root root     33 Jun  6 15:43 initrd.img -> /boot/initrd.img-4.0.5-5-ck-amd64
  50549 lrwxrwxrwx   1 root root     29 Jun  6 15:43 vmlinuz -> boot/vmlinuz-4.0.5-5-ck-amd64

Dass sich die Datei im System befindet, dass Grub verwaltet, sollte klar sein. cp -a $foo $bar ist auch korrekt. Ein Grub-Eintrag in der 11_playground könnte dann so aussehen:

Orginaler Eintrag:
Code: [Select]
       menuentry 'My System - current kernel (auf /dev/sdb2) (auf /dev/sda1) (auf /dev/sdb3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz--33439ad9-9337-4643-a5a2-ccb0e7b18ba9' {
                insmod part_gpt
                insmod ext2
                set root='hd1,gpt3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  33439ad9-9337-4643-a5a2-ccb0e7b18ba9
                else
                  search --no-floppy --fs-uuid --set=root 33439ad9-9337-4643-a5a2-ccb0e7b18ba9
                fi
                linux /vmlinuz root=LABEL=razor ro quiet nosplash
                initrd /initrd.img
        }


Wird zu:
Code: [Select]
       menuentry 'Razor (auf Label razor)' --class gnu-linux --class {
                insmod part_gpt
                insmod ext2
                linux /vmlinuz root=LABEL=razor ro quiet nosplash
                initrd /initrd.img
        }


Wichtig /vmlinux und /initrd.img sind relativ zu root - und wenn da root=UUID=$foo steht, dann halt dazu. Den search kann man sich ganz generös schenken. Alles was jetzt noch zu tun ist auf Playground - Anpassung der fstab, dass auch die richtigen beteiligten Partitionen angesprochen werden.

EDIT: Bevor Missverständnisse aufkommen - die benötigten Module müssen da natürlich drin stehen, das war nur ein willkürlicher Eintrag aus meinem System.
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. (Benjamin Franklin, November 11, 1755)
Never attribute to malice that which can be adequately explained by stupidity. (Hanlons razor)

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #7 on: 2015/09/06, 17:40:17 »
Thanks so far, but still something is going wrong:

default system on sdb1, currently booted:
experimental system to be booted on sdc1, currently mounted on /mnt/sdc1/:
Quote
# ls -la /mnt/sdc1/
insgesamt 132
...
lrwxrwxrwx   1 root root    45 Aug 12 12:24 initrd.img -> /boot/initrd.img-4.1.5-towo.1-siduction-amd64
lrwxrwxrwx   1 root root    45 Aug  7 12:19 initrd.img.old -> /boot/initrd.img-4.1.4-towo.1-siduction-amd64
...
lrwxrwxrwx   1 root root    41 Aug 12 12:24 vmlinuz -> boot/vmlinuz-4.1.5-towo.1-siduction-amd64
lrwxrwxrwx   1 root root    41 Aug  7 12:19 vmlinuz.old -> boot/vmlinuz-4.1.4-towo.1-siduction-amd64

# nano /mnt/sdc1/etc/grub.d/11_playground
menuentry 'siduction_experimental (auf Label s64_exp)' --class gnu-linux --class {
                insmod part_gpt
                insmod ext2
                linux /vmlinuz root=LABEL=s64_exp ro quiet nosplash
                initrd /initrd.img
        }
(I assume I do not need "part_gpt", but I guess it won't hurt, right?)

Is "--class gnu-linux --class" a remnant? I will now delete it and retry.

After creating 11_playground I run "update-grub", but on reboot there was no siduction_experimental entry.
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #8 on: 2015/09/06, 17:49:52 »
Quote

Dass sich die Datei im System befindet, dass Grub verwaltet, sollte klar sein.

... That seems to be the not so obvious error. I expected grub2 to be able to look for /etc/grub.d/* on whichever partition it finds. But you claim I have to create and customize /etc/grub2.d/11_playground on sdb1 ?

Ok, also auf der gebooteten partition, das erǵibt folgende fehlermeldung bei "update grub" mir folgendeen einträgen in der 11_playground:

Quote
/etc/grub.d/11_playground                                                   

menuentry 'siduction_experimental (auf Label s64_exp)' --class debian --class gnu-linux --class gnu --class os {
                insmod part_msdos
                insmod ext2
                linux /vmlinuz root=UUID=0c3780d8-9178-49ce-9e0f-6badcec38ddc ro quiet nosplash
                initrd /initrd.img
        }

update-grub
 
Quote
/etc/grub.d/11_playground: 1: /etc/grub.d/11_playground: menuentry: not found
insmod: ERROR: could not load module part_msdos: No such file or directory
insmod: ERROR: could not load module ext2: No such file or directory
/etc/grub.d/11_playground: 4: /etc/grub.d/11_playground: linux: not found
/etc/grub.d/11_playground: 5: /etc/grub.d/11_playground: initrd: not found
/etc/grub.d/11_playground: 6: /etc/grub.d/11_playground: Syntax error: "}" unexpected

Which modules do I need? No UEFI, no gpt here.  System is on ext4 partiton. Do I need some zip module, gzip or something else?


Could someone with a similar configuration post a working 40/41_custom or whatever customized grub_snippet? The info I found on the net is either outdated or incomplete.
« Last Edit: 2015/09/06, 19:11:13 by michaa7 »
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline piper

  • Global Moderator
  • User
  • *****
  • Posts: 1.717
  • we are the priests ... of the temples of syrinx
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #9 on: 2015/09/06, 20:02:55 »
My 40_custom, everything works well, some systems are installed, others are  using fromiso,  40_custom is pretty easy to use.

Code: [Select]
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  d214e821-0d19-45be-8770-dfdba028ba1f
else
  search --no-floppy --fs-uuid --set=root d214e821-0d19-45be-8770-dfdba028ba1f
fi
insmod png
if background_image /usr/share/images/desktop-base/joy-grub.png; then
  set color_normal=magenta/black
  set color_highlight=green/black
else
  set menu_color_normal=magenta/black
  set menu_color_highlight=green/black
fi
### END /etc/grub.d/05_debian_theme ###
menuentry 'Windows 7' --class windows --class os $menuentry_id_option 'osprober-chain-4182AD3F3349D507' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  4182AD3F3349D507
else
  search --no-floppy --fs-uuid --set=root 4182AD3F3349D507
fi
parttool ${root} hidden-
chainloader +1
}

set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Siduction-gnome' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7  0f242206-e2dc-4993-8c8e-f4e9cc3bef68
else
  search --no-floppy --fs-uuid --set=root 0f242206-e2dc-4993-8c8e-f4e9cc3bef68
fi
echo 'Loading Linux 3.16-3.towo-siduction-amd64 ...'
linux /boot/vmlinuz-3.16-3.towo-siduction-amd64 root=UUID=0f242206-e2dc-4993-8c8e-f4e9cc3bef68 ro  quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16-3.towo-siduction-amd64
}

set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Siduction-cinnamon' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos8'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8  804466e8-5bcc-47ff-82e7-9e042a4a4050
else
  search --no-floppy --fs-uuid --set=root 804466e8-5bcc-47ff-82e7-9e042a4a4050
fi
echo 'Loading Linux 3.16-3.towo.2-siduction-amd64 ...'
linux /boot/vmlinuz-3.16-3.towo.2-siduction-amd64 root=UUID=804466e8-5bcc-47ff-82e7-9e042a4a4050 ro  quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16-3.towo.2-siduction-amd64
}

set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Siduction-E17' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  b4885921-86d7-4f8e-ae2c-d15bd2db48fe
else
  search --no-floppy --fs-uuid --set=root b4885921-86d7-4f8e-ae2c-d15bd2db48fe
fi
echo 'Loading Linux 3.16-3.towo-siduction-amd64 ...'
linux /boot/vmlinuz-3.16-3.towo-siduction-amd64 root=UUID=b4885921-86d7-4f8e-ae2c-d15bd2db48fe ro  quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-3.16-3.towo-siduction-amd64
}

menuentry "Siduction-Live-lxqt-Development" {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-whiteroom-lxqt-amd64-201506161121.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-whiteroom-lxqt-amd64-201506161121.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}

menuentry "Siduction-Live-gnome-Development" {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-whiteroom-gnome-amd64-201506170024.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-whiteroom-gnome-amd64-201506170024.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}
menuentry "Siduction-Live-kde-Development" {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-whiteroom-kde-amd64-201507082224.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-whiteroom-kde-amd64-201507082224.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}
menuentry "Siduction-Live-kde-plasma5-Development" {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-whiteroom-kde5-amd64-201507181220.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-whiteroom-kde5-amd64-201507181220.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}
menuentry "Siduction-Live-e17-Development" {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-14.1.0-indiansummer-xorg-amd64-201409251725.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-14.1.0-indiansummer-xorg-amd64-201409251725.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}

menuentry "Siduction-Live-cinnamon-Development" --class siduction --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.0.5-towo.1-siduction-amd64-advanced-a85b1fd2-c48e-4c74-9c2e-481d02add362' {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-whiteroom-cinnamon-amd64-201506161121.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-whiteroom-cinnamon-amd64-201506161121.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}

menuentry 'SIDUCTION-TEST'  {
insmod iso9660
insmod part_gpt
insmod ext2
set root='hd1,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  192108a8-601e-4868-882d-97ad3042b5ee
else
  search --no-floppy --fs-uuid --set=root 192108a8-601e-4868-882d-97ad3042b5ee
fi
loopback loop /builds/siduction/siduction-15.1.0-thunderstruck-xorg-amd64-201509051137.iso
linux (loop)/boot/vmlinuz0.amd fromhd=UUID=192108a8-601e-4868-882d-97ad3042b5ee fromiso=/builds/siduction/siduction-15.1.0-thunderstruck-xorg-amd64-201509051137.iso boot=fll lang=en_US tz=America/New York quiet systemd.show_status=1 noeject toram
initrd (loop)/boot/initrd0.amd
}

set linux_gfx_mode=
export linux_gfx_mode
menuentry 'siduction 2015.1.0 whiteroom (kde) GNU/Linux, with Linux 4.1.2-towo.1-siduction-amd64' --class siduction --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.1.2-towo.1-siduction-amd64-advanced-7f0bf1dc-c498-444a-b88e-3df591a0370f' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos9'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos9 --hint-efi=hd0,msdos9 --hint-baremetal=ahci0,msdos9  7f0bf1dc-c498-444a-b88e-3df591a0370f
else
  search --no-floppy --fs-uuid --set=root 7f0bf1dc-c498-444a-b88e-3df591a0370f
fi
echo 'Loading Linux 4.1.2-towo.1-siduction-amd64 ...'
linux /boot/vmlinuz-4.1.2-towo.1-siduction-amd64 root=UUID=7f0bf1dc-c498-444a-b88e-3df591a0370f ro  quiet systemd.show_status=1 splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.1.2-towo.1-siduction-amd64
}



set linux_gfx_mode=
export linux_gfx_mode
menuentry 'siduction 2015.1.0 whiteroom (kde) GNU/Linux, with Linux 4.1.2-towo.1-siduction-amd64' --class siduction --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.1.2-towo.1-siduction-amd64-advanced-326b003d-7aac-4bbf-9796-709cd9339e2d' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10  326b003d-7aac-4bbf-9796-709cd9339e2d
else
  search --no-floppy --fs-uuid --set=root 326b003d-7aac-4bbf-9796-709cd9339e2d
fi
echo 'Loading Linux 4.1.2-towo.1-siduction-amd64 ...'
linux /boot/vmlinuz-4.1.2-towo.1-siduction-amd64 root=UUID=326b003d-7aac-4bbf-9796-709cd9339e2d ro  quiet systemd.show_status=1 splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.1.2-towo.1-siduction-amd64
}
« Last Edit: 2015/09/07, 01:54:28 by piper »
I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #10 on: 2015/09/06, 21:28:24 »
My 40_custom, everything works well, some systems are installed, others are  using fromiso,  40_custom is pretty easy to use.

#!/bin/sh
exec tail -n +3 $0

At least I now did understand that I had to add those two lines to the *script*. It wasn't very helpfull to omit these lines in the first example posted. If someone could explain the second line it would help me to understand why it needed to be there.

Now, with those two lines, there are no errors when "update-grub" is running, but the entry is created neither, no matter whether i use 11_playground or 40_custom.

This is how /etc/grub.d/40_custom now looks like:
Quote
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "experiment"{
insmod gzio
insmod part_msdos
set root='hd2,msdos1'
linux /vmlinuz root=UUID=0c3780d8-9178-49ce-9e0f-6badcec38ddc ro quiet nosplash
initrd /initrd.img
}

Still no clue which modules I need or where to find infos or why it still isn't creating the entry. Real help appreciated.

@ piper
Thanks for posting the file.
« Last Edit: 2015/09/06, 21:33:24 by michaa7 »
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline der_bud

  • User
  • Posts: 887
  • member
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #11 on: 2015/09/06, 21:57:51 »
Just a quick check, the 40_custom has to reside in /etc/grub.d in your sdb1, and it has to be executable ( -rwxr-xr-x 1 root root ).
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #12 on: 2015/09/06, 22:51:46 »
yes, it is executable and it is on sdb1 as  /etc/grub.d/40_custom.

Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline michaa7

  • User
  • Posts: 2.126
Re: grub2, howto boot a copied partition (for d-u experiments)
« Reply #13 on: 2015/09/06, 23:39:53 »
Hm, the thing is, the entry *has been created* different times, I can find it in /boot/grub/grub.cfg, which looks messed up (I did *not* edit it!)

Quote
...
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/11_playground ###
menuentry "experiment"{
insmod gzio
insmod part_msdos
set root='hd2,msdos1'
linux /vmlinuz root=UUID=0c3780d8-9178-49ce-9e0f-6badcec38ddc ro quiet nosplash
initrd /initrd.img
}
### END /etc/grub.d/11_playground ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###

...

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


### BEGIN /etc/grub.d/10_linux ###
menuentry "experiment" --class siduction --class gnu-linux --class gnu --class os{
insmod gzio
insmod part_msdos
set root='hd2,msdos1'
linux /vmlinuz root=UUID=0c3780d8-9178-49ce-9e0f-6badcec38ddc ro quiet nosplash
initrd /initrd.img
}
### END /etc/grub.d/10_linux ###
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/40_custom.save ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry "experiment" --class siduction --class gnu-linux --class gnu --class os{
insmod gzio
insmod part_msdos
set root='hd2,msdos1'
linux /vmlinuz root=UUID=0c3780d8-9178-49ce-9e0f-6badcec38ddc ro quiet nosplash
initrd /initrd.img
}

### END /etc/grub.d/40_custom.save ###

### BEGIN /etc/grub.d/41_custom ###
...

May I delete  /boot/grub/grub.cfg and recreate it using update-grub?

The confusing thing is: During "update-grub", what you see seems to be the os-prober output only, not the items that got created.
« Last Edit: 2015/09/07, 00:05:41 by michaa7 »
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline melmarker

  • Global Moderator
  • User
  • *****
  • Posts: 2.755
    • g-com.eu
only a hint - the os_prober part often create strange results - if one know what installations are on the system a handcrafted solution might be the better idea - and it is faster too :)

rationale: os_prober mount all available file systems and try to create a valid grub entry for every finding - some times os-probe loops, create strange results and so on. so i would suggest to run os-probe one time (maybe for windows or any bsd) and then create the entrys by hand. The needed modules are a little bit difficult, it depends on several factors like mbr/gpt/lvm and so on and the compression method of the kernel, several graphics options and so on - but for standard systems the modules from 10_linux might be sufficient and a good idea.
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. (Benjamin Franklin, November 11, 1755)
Never attribute to malice that which can be adequately explained by stupidity. (Hanlons razor)