install from second partition on usb-stick

Help with issues regarding installation of Debian
Locked
Message
Author
morgon
Posts: 189
Joined: 2010-08-28 03:04

install from second partition on usb-stick

#1 Post by morgon »

Hi,

I need to install Debian on a new system and don't want to dd the installer to my usb-stick as I have data on that.

So I've shrunk the filesystem on my usb-stick and created a second partition and then installed grub on the usb-stick.

Then I dd-ed the installer to the second partition and created an entry for grub like so:

Code: Select all

menuentry "Debian Installer" {
 set root=(hd0,2)
 chainloader +1
 boot
}
But alas, this does not work.

So is there a way to run the installer from the second partition of an usb-stick?

Many thanks!

brian_p
Posts: 150
Joined: 2015-11-05 10:32

Re: install from second partition on usb-stick

#2 Post by brian_p »

So is there a way to run the installer from the second partition of an usb-stick?
Yes, using the hd-media:

https://deb.debian.org/debian/dists/bus ... nt/images/.

Have you installed GRUB to the MBR of the stick? Doe the first
partition have /boot and /boot/grub?
--
Brian.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: install from second partition on usb-stick

#3 Post by Head_on_a_Stick »

See also sections A.2.4 & 5.1.5 of the official Debian buster installation guide.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

brian_p
Posts: 150
Joined: 2015-11-05 10:32

Re: install from second partition on usb-stick

#4 Post by brian_p »

> Yes, using the hd-media:

Thinking on, there is another technique that is less involved.

Backup your data and dd a netinst image to the stick. The data can be
put back in the free space on the disk.
--
Brian.

p.H
Posts: 1886
Joined: 2017-09-17 07:12

Re: install from second partition on usb-stick

#5 Post by p.H »

morgon wrote:But alas, this does not work.
This statement does not contain any useful information. Please describe what happens.

morgon
Posts: 189
Joined: 2010-08-28 03:04

Re: install from second partition on usb-stick

#6 Post by morgon »

brian_p wrote: Have you installed GRUB to the MBR of the stick? Doe the first
partition have /boot and /boot/grub?
Yes.
brian_p wrote: Yes, using the hd-media:
How then?

I have unsuccessfully tried to use it in my previous attempts to boot directly the iso file from a filesystem on the usb-stick,

The iso-file for the debian installer also resides in the "iso/deb" directory of the first partition.
I also have downloaded an initrd-file and tried this grub-entry:

Code: Select all

menuentry "debian testing install" {
 insmod ext2
 set iso="/iso/deb/debian-testing-amd64-netinst.iso"
 loopback loop (hd0,1)$iso
 linux (loop)/install.amd/vmlinuz iso-scan/filename=$iso iso-scan/ask_second_pass=true
 initrd /iso/deb/initrd.gz
}
And this boots but the installer then fails to find the iso.

This is extremely frustrating for me as I cannot find any documentation for the proper incantation of the iso-scan in this particular case.

So here we are:

The iso-image of the netinst-installer resides both on the filesystem of the first partition (ext2 filesystem) as well as on the second-partition.

I have been experimenting for hours with no avail.

How does a grub-entry look like that sucessfully runs this installer?

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: install from second partition on usb-stick

#7 Post by Head_on_a_Stick »

morgon wrote:How then?
[...]
How does a grub-entry look like that sucessfully runs this installer?
I wrote:See also sections A.2.4 & 5.1.5 of the official Debian buster installation guide.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

brian_p
Posts: 150
Joined: 2015-11-05 10:32

Re: install from second partition on usb-stick

#8 Post by brian_p »

morgon wrote:
How does a grub-entry look like that sucessfully runs this installer?
Put the hd-media vmlinuz and initrd.gz and the ISO in /boot.

Code: Select all

menuentry "debian testing install" {
   linux /boot/vmlinuz
   initrd /boot/initrd.gz
   }
You don't really need two partitions, do you?
--
Brian.

morgon
Posts: 189
Joined: 2010-08-28 03:04

Re: install from second partition on usb-stick

#9 Post by morgon »

Of course I don't need two partitions.

What I wanted to do is to boot the installer from the filesystem on the first partition (i.e. the iso-file sits in the filesystem) and I tried to make it boot via grub as above.

This is quite easily possible with other linux distros (even ubuntu). There you can ususally use the kernel and the initrd from within the iso - they don't need any "hd media" at all.

I never understood why debian is so different here and I simply cannot make it work. As I said it boots, but the installer then does not find the iso-file (ironically from where the kernel is loaded)...

Then I thought I give it a try by creating a second partition and writing the iso to that using dd, thinking it would be easy to boot that via grub, but I cannot make it work either.

Your suggestion from above results in an attempt to boot via ipxe which is also not what I want.

But I've run out of nerves with this now and I am giving up on it.

morgon
Posts: 189
Joined: 2010-08-28 03:04

Re: install from second partition on usb-stick

#10 Post by morgon »

Head_on_a_Stick wrote: (whatever)
Nothing personal, but would you please not "help" me anymore in the future?
I remember you posted in other threads of mine and nothing you ever posted was of any help for me.

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: install from second partition on usb-stick

#11 Post by Head_on_a_Stick »

morgon wrote:nothing you ever posted was of any help for me.
The sections I quoted in the official installation guide give explicit and precise instructions to do exactly what you want, perhaps try actually reading them instead of posting superfluous queries here like a help vampire?

Anyway, as the question has been answered I will lock this thread to prevent further deterioration.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

Locked