Re: installing debian 10 without a cd and without usb but could use ethernet
On Wed 20 Jan 2021 at 20:31:53 (-0800), Dan Hitt wrote:
> I have a machine that currently has linux mint 16.04 on it.
>
> I would like to install debian 10 on it, but the installer really wants
> access to a cd drive, and one just isn't available.
>
> However, the linux mint 16.04 system does have grub2 on it.
>
> So it is possible for me to boot from an iso image stored in the filesystem
> just like a regular file. It's just a matter of writing a menu entry in
> /etc/grub/40_custom.
>
> I know this works because i've booted into a live cd image of linux mint
> 20.1 (using the filesystem, not a cdrom), and started an installation
> process. I backed out of it, because i would like to install debian 10,
> not just a later version of mint.
>
> When i do the same thing with debian, it starts off ok, doing some simple
> things like setting the language and the keyboard layout, but then it
> complains that it cannot find a cd rom. This is true with both the netinst
> image, as well as with a jigdo xfce image which i think should have
> everything necessary and not need a cd rom. For reference, my debian menu
> entry is
>
> menuentry "debian-10-iso" {
> set isofile="/USER/iso/debian-10.7.0-amd64-xfce-CD-1.iso"
> loopback loop (hd0,gptNN)$isofile
> linux (loop)/install.amd/vmlinuz boot=install.amd
> iso-scan/filename=$isofile noprompt noeject
> initrd (loop)/install.amd/initrd.gz
> }
>
> Here, USER is the user name in whose account the iso image is, and gptNN
> stands for the particular partition where home is mounted for the user USER.
>
> So my first question is whether there's a better iso image i can use, or if
> i can fix this up by giving more arguments to the linux invocation line or
> something else in the menu entry.
I think what you're trying to do is §5.1.5 from
https://www.debian.org/releases/stable/i386/ch05s01.en.html#boot-initrd
using the hd-media. IIRC when I did this I used just
http://http.us.debian.org/debian/dists/buster/main/installer-i386/current/images/hd-media/
initrd.gz and vmlinuz, which gives you effectively a net install
(so you need connectivity).
My grub entry was (I use LABELs on my partitions):
menuentry "Install Debian via HTTP" {
search --no-floppy --label --set=root noah02
linux /boot/linux priority=low
initrd /boot/initrd.gz
}
as I downloaded the files into /boot (where everything else is versioned).
Low is like expert install, IIRC, asking all the questions.
I guess amd64 is the same, but only one i386 of mine can't boot from a stick.
> The second question is whether there's a way, from grub (grub2, actually),
> of dropping down to the bios. I imagine this is quite impossible, but if
> i'm wrong, please let me know. The reason i would like to do this is that
> it is very hard for me to interrupt the boot process fast enough to get to
> the bios, and i've only managed to do it once or twice after many tries.
> If i were in the bios, i might be able to figure out if it could boot from
> usb, and i could set the boot order to do this, and make a bootable usb
> version of netinst (perhaps).
>
> Or perhaps there's some other way to approach the problem? For example,
> i've already created a partition to hold the debian system i want to put on
> the machine. Is there some way of hand-populating it? I do have a running
> debian 10 system on another machine, and i suppose i could tar it up and
> unpack it into the new partition on the mint machine. But i'm not sure if
> there's something outside the filesystem but inside the partition which is
> necessary for it to be bootable.
I've certainly cloned systems in the past, using cpio as it happens.
But it was a long time ago, when eg /dev was a real directory with
real device files. I've even found the notes I used, but bear in mind
these were probably written in about 1998, and look rather quaint now,
so follow their intent rather than their method.
Copying (cloning) a partition or tree of files to another device:
(including when it's the live sysytem)
mount /dev/new-device-partition /mnt
cd old-directory-root
ls -lR > somewhere-on-a-stick (certainly not on /)
if we're in /, this listing needs pruning later as it will contain files on
other filesystems than -xdev is going to exclude. Note that switches
-ABQ might also be useful.
find -xdev -path './lost+found' -prune -o -print \
| cpio -vdamp /mnt
^ v is not essential
If this is on a different machine:
find -xdev -path './lost+found' -prune -o -print0 \
| cpio -ova0 | ssh user@host /mnt/placer.sh
where placer.sh contains:
cd $(dirname $0) ; cpio -dim --no-absolute-filenames
BUT BEWARE of changes in ownership.
cd /mnt/old-directory-root-name
ls -lR > somewhere-again (again, +- -ABQ switches)
then edit /etc/fstab and /mnt/etc/fstab
and /boot/grub/grub.cfg and /mnt/boot/grub/grub.cfg
ls-l-dedate the ls-lR files and diff the original and copy.
As you can see, back then I didn't know to use find with -printf,
rather than ls, so I had a python program to zap the directory
dates, and perhaps their sizes too.
Cheers,
David.
Reply to: