Monday, January 3, 2022

[SOLVED] install debian after boot?

Issue

Can I install Debian to a hard disk from a "custom made" ISO that has no "install" boot entry? I have tried the following which I can get to work, but only to a grub> prompt.

  • First I use gparted to make sda1 (ext4), sda2 (linux-swap) with labels. /dev/sda will be my target or working directory that I will chroot to.
  • use rsync to copy every dir in / EXCEPT (/mnt/target,home,live,cdrom,mnt,proc,run,sys,media) to /mnt/target
  • create empty directories (proc,mnt,run,sys,media/cdrom,tmp) in my target /mnt/target
  • I mount three directories into the chroot: mount -o bind /proc /mnt/target/proc #same for sys and dev also!
  • Finally, chroot to the target (sda1): chroot /mnt/target
  • remove the fstab from /etc and make a new one with just sda1 (/) and sda2 (swap)
  • restore "update-initramfs" tool in the chrooted /mnt/target from /mnt/target/usr/sbin/update-initramfs.orig.initramfs-tools (I guess live-boot replaces it?)
  • run update-initramfs in chrooted target: update-initramfs -t -c -k $(uname -r)
  • Then, update GRUB2 with: update-grub

I get no errors at all. Somehow, I cannot get a Grub menu. I even tried booting it with the grub> prompt but I cannot. I am completely lost. Should I reinstall grub and linux-image within the chroot, THEN rerun the update-initramfs and update-grub tools? in /boot I only have "./grub" and the "initrd.linux-i686-pae" files. The grub.cfg IS in ./grub, but it doesn't have a "menuentry" line for the kernel!

I'm a dope. I was developing a custom ISO in a VMWare virtual disk that got deleted. :( I bought Recuva but it couldn't find the 25GB vdisk file, even when I pointed it to the C:\Users\ME\Documents\VMWare Disks\ directory. I know I am guilty of not backing it up. But I DO have an ISO backup I luckily made using xoriso following tutorials online. But it only boots and runs fine, there is no "installer" application that I can find in aptitude and I cannot modify the isolinux boot menu to add anything. :( I am stuck. I swear I searched as far and as wide as I possibly could - reading and testing for days. Finally, I come to your wisdom.

Thanks in advance!


Solution

From the chroot on sda1 run sudo dpkg-reconfigure grub-pc, and set up grub accordingly.

(The OP reports that this solved the problem.)



Answered By - agc