Re: Re: (Thread restarted!) Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Hello everyone, I partly solved my problem and I would like to share my solution: Until now, I thought that the EFI removable media path (\EFI\BOOT\BOOTX64.EFI) is really a fallback location, i.e. a location for putting the boot loader that just always works. Therefore I thought that I could forget about EFI variables altogether if I just put the boot loader there. My recipes don't bind-mount /sys/firmware/efi/efivars for that reason. And when trying things out with the emulator, this assumption holds true, i.e. running "qemu-system-x86_64 -accel kvm -bios /usr/share/ovmf/OVMF.fd ..." will create a virtual machine that behaves like I expected. However, my Asus UX31A does things differently and insists on EFI variables being used for the internal drive, i.e. it doesn't look at the fallback location (\EFI\BOOT\BOOTX64.EFI) of the internal drive. That's the solution for the EFI boot interface, use EFI variables. For the BIOS boot interface, I'm still clueless why it doesn't work. However, I'll leave it at that. Thanks to everyone who helped! Kind regards, Valentin Caracalla
Re: (Thread restarted!) Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On Thu 27 Apr 2023 at 10:18:56 (+0700), Max Nikulin wrote: > On 26/04/2023 22:57, Valentin Caracalla wrote: > > the issue with the BIOS boot interface (see my original posting) is still > > unsolved > > I had impression that there was no issue with booting in BIOS (legacy, > compatibility, CSM) mode, of course when it is chosen in firmware/BIOS > setup (requires disabling of secure boot). Well, the OP wrote: "Previously, I've successfully installed Debian using official installation media on this machine (also using BIOS boot interface), so I know that it works in principle. But now I want to do it using command line utilities like debootstrap and grub-install." But: "the problem is that the ESC boot menu doesn't show an entry for (the model name of) /dev/sda, so I can't boot into it." My first question would be whether it makes a difference to use [F2] and enter the BIOS/CMOS, rather than [ESC] to get just the boot list. As you could read in another thread, I have been testing the d-i installing on a BIOS machine, using a spare partition, in order to see how it behaves with and without a BIOS Boot partition. However, blanking the entire internal drive on a machine just for this exercise is pushing things a bit too far, sorry. And I'm not sure that results from one of /my/ machines would be particularly useful either. They are either native BIOS booters, or have a compatibility mode that just works, without requiring anything out of the ordinary configured for a GPT disk in BIOS mode. That might not be true for your Asus UX31A. At this point, my action would be to install in BIOS mode using your two methods, conventional d-i and debootstrap, and run bootinfoscript (from package boot-info-script) on each, to look for differences. I would avoid doing any UEFI booting between these runs. Cheers, David.
Re: (Thread restarted!) Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On 26/04/2023 22:57, Valentin Caracalla wrote: the issue with the BIOS boot interface (see my original posting) is still unsolved I had impression that there was no issue with booting in BIOS (legacy, compatibility, CSM) mode, of course when it is chosen in firmware/BIOS setup (requires disabling of secure boot). Perhaps I confused it with qemu instead of bare metal. I tried using the EFI removable media path (which should bypass any issues with EFI variables) without success. This statement might be too strong. Internal drive is not a removable media. My impression is that you can boot from removable media (live CD), but not from internal drive. - Is booting from that internal drive enabled in firmware setup? - Is shim-signed package installed? Just shim is not enough when secure boot is enabled in firmware. I want to install Debian on my Asus UX31A UEFI implementation may have some peculiarities, likely you will find more pages: https://wiki.osdev.org/Broken_UEFI_implementations https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface#Troubleshooting I want to install it to the internal drive /dev/sda, and I want to do so by executing commands on an installer system, which is a system already installed on the external drive /dev/sdb. Does it mean that you have another linux installed and there is no issue with its booting? Is it debian? For now, I only want to get a GRUB command line, because that appears to be the difficult part. Then you do not need debian installer at all. To debug such issues it is enough to copy files to EFI/debian and to run a couple of efibootmgr commands. By the way, you have not posted "efibootmgr -v" or at least "efibootmgr" output. Running it from an existing install or a live media is OK. For the BIOS boot interface: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart root 512MiB 100% sudo parted /dev/sda set 1 bios_grub on Perhaps you may create both BIOS Boot and EFI System partitions on the same disk to support both modes. For the EFI boot interface: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart init 0% 512MiB sudo parted /dev/sda set 1 boot on sudo mkfs.vfat /dev/sda1 I do not remember if the "boot" flag sets proper GUID for ESP. I have heard that there may be issues if fat16 is used instead of fat32 https://www.rodsbooks.com/gdisk/booting.html file --special /dev/sda1 parted /dev/sda print sgdisk -p /dev/sda (Some people may be more familiar with output of sgdisk than parted) sudo mount --bind /sys /mnt/sys sudo mount --bind /proc /mnt/proc sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /run /mnt/run I still do not see /sys/firmware/efi/efivars here. Check /mnt/sys/firmware/efi/efivars Frankly speaking, I am confused by your description. I suspect it is a mix of - What you are going to do in future (having working install, prepare a disk for another machine or install a fresh system for the same computer) - What you are really doing - Recipe which way others may try reproduce (boot from a live media and install to an internal drive) Let's concentrate on UEFI. Unless you faced an Asus-specific issue, it should be possible to use qemu+OVMF.
(Thread restarted!) Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Hello Max, thanks a lot for your input! I do, however, believe that the problem has a different cause. I came to that conclusion, mainly because the issue with the BIOS boot interface (see my original posting) is still unsolved, but also because I tried using the EFI removable media path (which should bypass any issues with EFI variables) without success. Therefore, and to make it easier for new people entering this thread, I restart the thread now by asking my original question again, in a single and well arranged posting. You can forget everything you read in the thread before if you just read this one post: Hello everyone, I want to install Debian on my Asus UX31A using command line utilities like debootstrap and grub-install. I want to install it to the internal drive /dev/sda, and I want to do so by executing commands on an installer system, which is a system already installed on the external drive /dev/sdb. To reproduce the issue, you should use a current stable Debian Live-CD as the installer system. Just write the Live-CD image to the external drive /dev/sdb using dd. For now, I only want to get a GRUB command line, because that appears to be the difficult part. Here are the step-by-step instructions to reproduce the problem: 1.: On the installer system, type "sudo apt install ..." to install any dependencies required by the recipe (see below). 2.: On the installer system, exercise one of the following two recipes: For the BIOS boot interface: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart init 0% 512MiB sudo parted /dev/sda mkpart root 512MiB 100% sudo parted /dev/sda set 1 bios_grub on sudo mkfs.ext4 /dev/sda2 sudo mount /dev/sda2 /mnt sudo debootstrap stable /mnt sudo mount --bind /sys /mnt/sys sudo mount --bind /proc /mnt/proc sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /run /mnt/run sudo chroot /mnt apt install grub-pc sudo chroot /mnt grub-install /dev/sda sudo umount /mnt/run sudo umount /mnt/dev/pts sudo umount /mnt/dev sudo umount /mnt/proc sudo umount /mnt/sys sudo umount /mnt For the EFI boot interface: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart init 0% 512MiB sudo parted /dev/sda mkpart root 512MiB 100% sudo parted /dev/sda set 1 boot on sudo mkfs.vfat /dev/sda1 sudo mkfs.ext4 /dev/sda2 sudo mount /dev/sda2 /mnt sudo mkdir /mnt/boot sudo mkdir /mnt/boot/efi sudo mount /dev/sda1 /mnt/boot/efi sudo debootstrap stable /mnt sudo mount --bind /sys /mnt/sys sudo mount --bind /proc /mnt/proc sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /run /mnt/run sudo chroot /mnt apt install grub-efi sudo chroot /mnt grub-install --target=x86_64-efi /dev/sda sudo chroot /mnt grub-install --target=x86_64-efi --removable /dev/sda sudo umount /mnt/runsudo umount /mnt/dev/pts sudo umount /mnt/dev sudo umount /mnt/proc sudo umount /mnt/sys sudo umount /mnt/boot/efi sudo umount /mnt Please check every command's output before entering the next one. 3.: Shut down the installer system and disconnect the external drive /dev/sdb. 4.: Start the computer with the ESC key pressed. This will show a list of boot options (the ESC boot menu). The expected behavior is that the list contains an entry for the installed system. Selecting that entry will give you a GRUB command line. The actual behavior is that there is only the "Enter Setup" entry in the list, which is always there and does not do what we want (boot to GRUB command line). That much for the step-by-step instructions. Notice that the EFI variant of the recipe does set the "boot" and "esp" flags and the partition has the recommended size. Also notice that the EFI recipe will create the following directory structure on /dev/sda1: drwxr-xr-x 3 root root 16384 Jan 1 1970 /mnt/boot/efi drwxr-xr-x 4 root root 8192 Apr 26 09:33 /mnt/boot/efi/EFI drwxr-xr-x 2 root root 8192 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT -rwxr-xr-x 1 root root 108 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/BOOTX64.CSV -rwxr-xr-x 1 root root 934240 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/BOOTX64.EFI -rwxr-xr-x 1 root root 84648 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/fbx64.efi -rwxr-xr-x 1 root root 126 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/grub.cfg -rwxr-xr-x 1 root root 3827136 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/grubx64.efi -rwxr-xr-x 1 root root 845480 Apr 26 09:33 /mnt/boot/efi/EFI/BOOT/mmx64.efi drwxr-xr-x 2 root root 8192 Apr 26 09:33 /mnt/boot/efi/EFI/debian -rwxr-xr-x 1 root root 108 Apr 26 09:33 /mnt/boot/efi/EFI/debian/BOOTX64.CSV -rwxr-xr-x 1 root root 84648 Apr 26 09:33 /mnt/boot/efi/EFI/debian/fbx64.efi -rwxr-xr-x 1 root root 126 Apr 26 09:33 /mnt/boot/efi/EFI/debian/grub.cfg -rwxr-xr-x 1 root root 4150720 Apr 26 09:33 /mnt/boot/efi/EFI/debian/grubx64.efi -rwxr-xr-x 1 root root 845480 Apr 26 09:33 /mnt/boot/efi/EFI/debian/mmx64.efi -rwxr-xr-x 1 root root 934240 Apr 26 09:33
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
David Wright (12023-04-25): > Don't knock it! The Human Era is much easier for us to parse than ;-) > the French Republican calendar (pre 2018). I had not realized I had fans devoted to the point of tracking the eras of my mail attribution. ;-)² Regards, -- Nicolas George signature.asc Description: PGP signature
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Greg Wooledge (12023-04-25): > find /mnt/boot/efi -exec ls -dl {} + zsh ls -dl /mnt/boot/efi/**/* Regards, -- Nicolas George signature.asc Description: PGP signature
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On Wed 26 Apr 2023 at 09:14:25 (+0700), Max Nikulin wrote: > On 26/04/2023 00:42, Nicolas George wrote: > > Steve McIntyre (12023-04-25): [ … ] > P.S. Nicolas, it seems your mailer has issues with parsing or > formatting timestamps. Don't knock it! The Human Era is much easier for us to parse than the French Republican calendar (pre 2018). Fortunately, we didn't have to deal with decimal time. Cheers, David.
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On Wed, Apr 26, 2023 at 09:34:11AM +0700, Max Nikulin wrote: > On 26/04/2023 05:02, Valentin Caracalla wrote: > > > > user@host:~$ ls -dl $(find /mnt/boot/efi) > > find /mnt/boot/efi -print0 | xargs -0 ls -dl -- > > should be more resistant to peculiar file names, but it does not matter in > this case. find /mnt/boot/efi -exec ls -dl {} + Also, GNU find has a -ls action, which has a different format, but is worth a look: find /mnt/boot/efi -ls
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On 26/04/2023 05:02, Valentin Caracalla wrote: user@host:~$ ls -dl $(find /mnt/boot/efi) find /mnt/boot/efi -print0 | xargs -0 ls -dl -- should be more resistant to peculiar file names, but it does not matter in this case. ... -rwxr-xr-x 1 root root 126 Apr 25 13:59 /mnt/boot/efi/EFI/debian/grub.cfg -rwxr-xr-x 1 root root 4150720 Apr 25 13:59 /mnt/boot/efi/EFI/debian/grubx64.efi ... Unless firmware is buggy and it requires EFI/BOOT/BOOTX64.EFI removable layout, it should be enough (of course with other files that I removed from the quote). user@host:~$ efibootmgr -v EFI variables are not supported on this system. Either you run it from qemu booted in BIOS mode or you did not mount to chroot (I have never tried to manage EFI variables from chroot) efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) Likely it is the reason why installer was not able to create a Boot entry and to adjust BootOrder.
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On 26/04/2023 00:42, Nicolas George wrote: Steve McIntyre (12023-04-25): If you do not intend to install a Microsoft bootloader or anything besides GRUB, 16 megaoctets is plenty enough, probably can work with less. Please STOP giving this advice to people! That was not advice, that was information. Make your own advice with it. Unified Kernel Images are coming (kernel + initramfs e.g. to avoid separate unencrypted /boot), so even 550MiB may become too small partition in a couple of years. P.S. Nicolas, it seems your mailer has issues with parsing or formatting timestamps.
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Valentin Caracalla (12023-04-26): > EFI variables are not supported on this system. To install GRUB in UEFI, you need to have booted the kernel in UEFI. Try to find a live image that does, and you can reinstall GRUB from there. Regards, -- Nicolas George signature.asc Description: PGP signature
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Here's the output you requested: user@host:~$ ls -dl $(find /mnt/boot/efi) drwxr-xr-x 3 root root 32768 Jan 1 1970 /mnt/boot/efi drwxr-xr-x 3 root root 32768 Apr 25 13:59 /mnt/boot/efi/EFI drwxr-xr-x 2 root root 32768 Apr 25 13:59 /mnt/boot/efi/EFI/debian -rwxr-xr-x 1 root root 108 Apr 25 13:59 /mnt/boot/efi/EFI/debian/BOOTX64.CSV -rwxr-xr-x 1 root root 84648 Apr 25 13:59 /mnt/boot/efi/EFI/debian/fbx64.efi -rwxr-xr-x 1 root root 126 Apr 25 13:59 /mnt/boot/efi/EFI/debian/grub.cfg -rwxr-xr-x 1 root root 4150720 Apr 25 13:59 /mnt/boot/efi/EFI/debian/grubx64.efi -rwxr-xr-x 1 root root 845480 Apr 25 13:59 /mnt/boot/efi/EFI/debian/mmx64.efi -rwxr-xr-x 1 root root 934240 Apr 25 13:59 /mnt/boot/efi/EFI/debian/shimx64.efiuser@host:~$ efibootmgr -v EFI variables are not supported on this system.
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Steve McIntyre (12023-04-25): > >If you do not intend to install a Microsoft bootloader or anything > >besides GRUB, 16 megaoctets is plenty enough, probably can work with > >less. > Please STOP giving this advice to people! That was not advice, that was information. Make your own advice with it. -- Nicolas George signature.asc Description: PGP signature
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Nicolas George wrote: >Max Nikulin (12023-04-25): >> 0.5GB is usually enough, e.g. 550MiB recommended by >> https://www.rodsbooks.com/gdisk/advice.html#esp_sizing) > >If you do not intend to install a Microsoft bootloader or anything >besides GRUB, 16 megaoctets is plenty enough, probably can work with >less. Please STOP giving this advice to people! Running out of space on the ESP may cause a lot of hassle later. *Right now*, GRUB is small. But things do grow over time. Also, if anybody wants to install an extra OS, or use fwupd to install firmware updates (for example), saving a small amount of disk space here could cause a massive PITA later. -- Steve McIntyre, Cambridge, UK.st...@einval.com < sladen> I actually stayed in a hotel and arrived to find a post-it note stuck to the mini-bar saying "Paul: This fridge and fittings are the correct way around and do not need altering"
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Max Nikulin (12023-04-25): > 0.5GB is usually enough, e.g. 550MiB recommended by > https://www.rodsbooks.com/gdisk/advice.html#esp_sizing) If you do not intend to install a Microsoft bootloader or anything besides GRUB, 16 megaoctets is plenty enough, probably can work with less. Regards, -- Nicolas George signature.asc Description: PGP signature
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
On 25/04/2023 21:40, Valentin Caracalla wrote: I checked my partition table using "sudo parted /dev/sda print" Number Start End Size File system Name Flags 1 1049kB 128GB 128GB fat32 init boot, esp 2 128GB 256GB 128GB ext4 root Please, show ls -lA EFI/BOOT ls -lA EFI/debian residing on /dev/sda1 (128GB sounds like unreasonable large ESP partition, 0.5GB is usually enough, e.g. 550MiB recommended by https://www.rodsbooks.com/gdisk/advice.html#esp_sizing) efibootmgr -v See https://wiki.debian.org/UEFI
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
vorubergeh...@tutanota.com wrote: >By the way: > >The disadvantage of using EFI is that it doesn't work in QEMU, i.e. the >following will not show a GRUB command line: > >sudo qemu-system-x86_64 -accel kvm -smp 2 -m 2G /dev/sda > >The same thing works for the BIOS boot interface, however (as in my original >recipe). That's just qemu-system-x86_64 defaulting to using SeaBIOS for firmware. I boot VMs in UEFI mode all the time, using the EDK2 binary builds in the ovmf package. -- Steve McIntyre, Cambridge, UK.st...@einval.com < sladen> I actually stayed in a hotel and arrived to find a post-it note stuck to the mini-bar saying "Paul: This fridge and fittings are the correct way around and do not need altering"
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Valentin Caracalla (12023-04-25): > The disadvantage of using EFI is that it doesn't work in QEMU, i.e. the > following will not show a GRUB command line: > > sudo qemu-system-x86_64 -accel kvm -smp 2 -m 2G /dev/sda Oh, I must check if the KVM virtual machine booting on UEFI I have been toying with these lasts few weeks really exists then. Regards, -- Nicolas George signature.asc Description: PGP signature
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
By the way: The disadvantage of using EFI is that it doesn't work in QEMU, i.e. the following will not show a GRUB command line: sudo qemu-system-x86_64 -accel kvm -smp 2 -m 2G /dev/sda The same thing works for the BIOS boot interface, however (as in my original recipe).
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
I apologize for the formatting in my last post, I don't know what happened. And many thanks for your help! I checked my partition table using "sudo parted /dev/sda print" and it didn't show any flags for partition 1 (the "init" partition). Therefore I manually set the flags using "sudo parted /dev/sda set 1 boot on" and now it shows both flags, "boot" and "esp": Model: ATA ADATA XM11 256GB (scsi) Disk /dev/sda: 256GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 128GB 128GB fat32 init boot, esp 2 128GB 256GB 128GB ext4 root However, after reboot, the ESC boot menu still doesn't show an entry for the installed system.
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Valentin Caracalla writes: > But this doesn't work either. Same problem here. However I can make > such an EFI installation using official installation media on the same > machine and that does work. That recipe (and the whole post) was hard to read but don't you need some flags for the ESP partition, like esp and possibly boot as well? The partition table on one EFI system I have looks like this, I think it's probably what Debian installer created: # parted /dev/nvme0n1 print Model: KINGSTON SA2000M8250G (nvme) Disk /dev/nvme0n1: 250GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start EndSizeFile system NameFlags 1 1049kB 538MB 537MB fat32 boot, esp 2 538MB 249GB 248GB ext4Zippy root 3 249GB 250GB 1024MB linux-swap(v1) Zippy swap swap
Re: Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
> I can't see anything wrong with the script. Did that installation use> GPT > and a BIOS Boot Partition though?The successful installation (with official > installation media) used aBIOS partition table, but I prefer GPT.> I guess I > have to ask, why not just use UEFI?I also tried that and I considered posting > a similar recipe for EFI in thefirst message. But it doesn't work either, so > I thought it is better toask the question with BIOS, because it seemed easier > to me.Here's the recipe for EFI: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart init 0% 50% sudo parted /dev/sda mkpart root 50% 100% sudo mkfs.vfat /dev/sda1 sudo mkfs.ext4 /dev/sda2 sudo mount /dev/sda2 /mnt sudo mkdir /mnt/boot sudo mkdir /mnt/boot/efi sudo mount /dev/sda1 /mnt/boot/efi sudo debootstrap stable /mnt sudo mount --bind /sys /mnt/sys sudo mount --bind /proc /mnt/proc sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /run /mnt/run sudo chroot /mnt apt install grub-efi sudo chroot /mnt grub-install /dev/sda sudo umount /mnt/run sudo umount /mnt/dev/pts sudo umount /mnt/dev sudo umount /mnt/proc sudo umount /mnt/sys sudo umount /mnt/boot/efi sudo umount /mntBut this doesn't work either. Same problem here. However I can make such anEFI installation using official installation media on the same machine andthat does work.
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
There are a few things I forgot to say: The recipe I posted earlier is executed on a system installed on the external drive /dev/sdb, which I call the installer system. It is also a Debian system, with the recipe's dependencies installed. To reproduce the issue (if you want), I suggest using a Debian Live-CD. After installation and before attempting to boot I unplug the external drive to make sure it doesn't interfere with the boot process. With the external drive unplugged, there should be exactly one entry in the ESC boot menu, but there is none: It only offers me to enter setup, and that is what it does when I boot without pressing ESC. Instead of booting the computer directly, I also tried booting the internal drive in a VM executed on the installer system using the following command: sudo qemu-system-x86_64 -accel kvm -smp 2 -m 2G /dev/sda This will show a GRUB command line as I expected. It just doesn't work on the real system, but in the VM it works (I hate that).
Re: Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Valentin Caracalla writes: > Previously, I've successfully installaed Debian using official > installation media on this machine (also using BIOS boot interface), > so I know that it works in principle. I can't see anything wrong with the script. Did that installation use GPT and a BIOS Boot Partition though? I guess I have to ask, why not just use UEFI?
Debian installation using debootstrap and grub-install - no entry in ESC boot menu
Hello everyone, I'm trying to install Debian on my Asus UX31A using command line utilities like debootstrap and grub-install. However, the installed system is not bootable. The problem is that the internal drive (which I install the system to) doesn't show up in the boot menu (which is what the user sees when pressing ESC during power-on). I created a minimalist recipe demonstrating the issue: sudo parted /dev/sda mklabel gpt sudo parted /dev/sda mkpart init 0% 50% sudo parted /dev/sda mkpart root 50% 100% sudo parted /dev/sda set 1 bios_grub on sudo mkfs.ext4 /dev/sda2 sudo mount /dev/sda2 /mnt sudo debootstrap stable /mnt sudo mount --bind /sys /mnt/sys sudo mount --bind /proc /mnt/proc sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /run /mnt/run sudo chroot /mnt apt install grub-pc sudo chroot /mnt grub-install /dev/sda sudo umount /mnt/run sudo umount /mnt/dev/pts sudo umount /mnt/dev sudo umount /mnt/proc sudo umount /mnt/sys sudo umount /mnt I've intentionally stripped the parts concerning installation of a kernel and creating configuration files like grub.cfg and fstab, these things work already. For now, all I want to see is that the user can get a GRUB command line after power-on. The grub-install command outputs "Installation finished. No error reported." and therefore I expect being able to boot into the GRUB command line. But again, the problem is that the ESC boot menu doesn't show an entry for (the model name of) /dev/sda, so I can't boot into it. Previously, I've successfully installed Debian using official installation media on this machine (also using BIOS boot interface), so I know that it works in principle. But now I want to do it using command line utilities like debootstrap and grub-install. Any help would be very appreciated. Kind regards, Valentin Caracalla
Re: Buster install using debootstrap. (SOLVED)
On 6/5/20 6:31 PM, Marc Shapiro wrote: On 6/4/20 11:30 PM, Sven Hartge wrote: Marc Shapiro wrote: I also don't understand why it says that it could not create temporary files in /tmp. I am running this as root and /tmp is owned by root. What am I missing? /tmp (and /var/tmp/) should have the following permissions and rights: root:root 1777/drwxrwxrwt apt runs its I/O processes as a different user "_apt" and if /tmp does not have the sticky bit set, then it cannot create any files there, causing the error. Grüße, Sven. Thanks! That took care of all the debian repositories. Third party repositories are now having public key issues (not surprising). How do I get and install the public key for deb-multimedia.org and virtualbox.org? Marc I got the public keys for deb-multimedia.org and virtualbox.org and all is good. I just needed to google a little more (after having some dinner). Marc
Re: Buster install using debootstrap.
On 6/4/20 11:30 PM, Sven Hartge wrote: Marc Shapiro wrote: I also don't understand why it says that it could not create temporary files in /tmp. I am running this as root and /tmp is owned by root. What am I missing? /tmp (and /var/tmp/) should have the following permissions and rights: root:root 1777/drwxrwxrwt apt runs its I/O processes as a different user "_apt" and if /tmp does not have the sticky bit set, then it cannot create any files there, causing the error. Grüße, Sven. Thanks! That took care of all the debian repositories. Third party repositories are now having public key issues (not surprising). How do I get and install the public key for deb-multimedia.org and virtualbox.org? Marc
Re: Buster install using debootstrap.
On Fri, Jun 05, 2020 at 08:30:16AM +0200, Sven Hartge wrote: > Marc Shapiro wrote: > > > I also don't understand why it says that it could not create temporary > > files in /tmp. I am running this as root and /tmp is owned by root. > > What am I missing? > > /tmp (and /var/tmp/) should have the following permissions and rights: > > root:root 1777/drwxrwxrwt > > apt runs its I/O processes as a different user "_apt" and if /tmp does > not have the sticky bit set, then it cannot create any files there, > causing the error. > Another thing to check (which may or may not apply in this particular instance) is any special TMP/TEMP/TMPDIR/TEMPDIR environment variable handling in the host environment. On my systems I use pam_tmpdir, which creates a user-specific temporary directory (/tmp/user/${UID}) and then sets the TMP/TEMP/TMPDIR/TEMPDIR environment variables to that path. When I chroot into an environment, I must take care to either ensure those variables are unset inside the chroot or to create the necessary directory structure with matching ownership and permissions. Another solution is to bind mount /tmp from the host into the chroot. Regards, -Roberto -- Roberto C. Sánchez
Re: Buster install using debootstrap.
Greg Wooledge wrote: > On Fri, Jun 05, 2020 at 08:30:16AM +0200, Sven Hartge wrote: >> Marc Shapiro wrote: >>> I also don't understand why it says that it could not create temporary >>> files in /tmp. I am running this as root and /tmp is owned by root. >>> What am I missing? >> >> /tmp (and /var/tmp/) should have the following permissions and rights: >> >> root:root 1777/drwxrwxrwt >> >> apt runs its I/O processes as a different user "_apt" and if /tmp does >> not have the sticky bit set, then it cannot create any files there, >> causing the error. > To be completely clear, it's the world-write bit that allows _apt to > create files/subdirectories there. The sticky bit prevents other > users from removing or renaming said files/subdirectories while _apt > is using them. Eh, yes, of course. Was ahead in my thoughts and mixed both facts together. Grüße, Sven. -- Sigmentation fault. Core dumped.
Re: Buster install using debootstrap.
On Fri, Jun 05, 2020 at 08:30:16AM +0200, Sven Hartge wrote: > Marc Shapiro wrote: > > > I also don't understand why it says that it could not create temporary > > files in /tmp. I am running this as root and /tmp is owned by root. > > What am I missing? > > /tmp (and /var/tmp/) should have the following permissions and rights: > > root:root 1777/drwxrwxrwt > > apt runs its I/O processes as a different user "_apt" and if /tmp does > not have the sticky bit set, then it cannot create any files there, > causing the error. To be completely clear, it's the world-write bit that allows _apt to create files/subdirectories there. The sticky bit prevents other users from removing or renaming said files/subdirectories while _apt is using them.
Re: Buster install using debootstrap.
Marc Shapiro wrote: > I also don't understand why it says that it could not create temporary > files in /tmp. I am running this as root and /tmp is owned by root. > What am I missing? /tmp (and /var/tmp/) should have the following permissions and rights: root:root 1777/drwxrwxrwt apt runs its I/O processes as a different user "_apt" and if /tmp does not have the sticky bit set, then it cannot create any files there, causing the error. Grüße, Sven. -- Sigmentation fault. Core dumped.
Buster install using debootstrap.
I have just installed Buster on a spare set of partitions using debootstrap, as documented in: Appendix D.3 of the Installation Guide. When I got to configuring networking, I just copied /etc/networking/interfaces, /etc/hosts, /etc/hostname, and /etc/resolv.conf from my Stretch partitions/directories to the Buster partitions/directories. I also copied /etc/apt/sources.list and /etc/fstab from Stretch to Buster, editing them as needed. I have chrooted into Buster and everything looks good. I can run 'apt show' and 'dpkg -l' (I like the way the new dpkg lets you scroll through the list instead of just running to the end.) What I can not do is 'apt update'. When I try that, I get the following output: # apt update Get:1 http://security.debian.org buster/updates InRelease [65.4 kB] Err:1 http://security.debian.org buster/updates InRelease Couldn't create temporary file /tmp/apt.conf.UOJmdX for passing config to apt-key Get:2 http://download.virtualbox.org/virtualbox/debian buster InRelease [7736 B] Err:2 http://download.virtualbox.org/virtualbox/debian buster InRelease Couldn't create temporary file /tmp/apt.conf.9n943a for passing config to apt-key Get:4 http://http.us.debian.org/debian buster InRelease [121 kB] Err:4 http://http.us.debian.org/debian buster InRelease Couldn't create temporary file /tmp/apt.conf.1btx9y for passing config to apt-key Get:3 http://cdn-fastly.deb.debian.org/debian buster-backports InRelease [46.7 kB] Err:3 http://cdn-fastly.deb.debian.org/debian buster-backports InRelease Couldn't create temporary file /tmp/apt.conf.G6FHYS for passing config to apt-key Get:5 http://www.deb-multimedia.org buster InRelease [19.5 kB] Err:5 http://www.deb-multimedia.org buster InRelease Couldn't create temporary file /tmp/apt.conf.Iqzykk for passing config to apt-key Get:6 http://www.deb-multimedia.org buster-backports InRelease [10.4 kB] Err:6 http://www.deb-multimedia.org buster-backports InRelease Couldn't create temporary file /tmp/apt.conf.Sb90kl for passing config to apt-key Reading package lists... Done W: GPG error: http://security.debian.org buster/updates InRelease: Couldn't create temporary file /tmp/apt.conf.UOJmdX for passing config to apt-key E: The repository 'http://security.debian.org buster/updates InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://download.virtualbox.org/virtualbox/debian buster InRelease: Couldn't create temporary file /tmp/apt.conf.9n943a for passing config to apt-key E: The repository 'http://download.virtualbox.org/virtualbox/debian buster InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://http.us.debian.org/debian buster InRelease: Couldn't create temporary file /tmp/apt.conf.1btx9y for passing config to apt-key E: The repository 'http://http.us.debian.org/debian buster InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://cdn-fastly.deb.debian.org/debian buster-backports InRelease: Couldn't create temporary file /tmp/apt.conf.G6FHYS for passing config to apt-key E: The repository 'http://http.debian.net/debian buster-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://www.deb-multimedia.org buster InRelease: Couldn't create temporary file /tmp/apt.conf.Iqzykk for passing config to apt-key E: The repository 'http://www.deb-multimedia.org buster InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: GPG error: http://www.deb-multimedia.org buster-backports InRelease: Couldn't create temporary file /tmp/apt.conf.Sb90kl for passing config to apt-key E: The repository 'http://www.deb-multimedia.org buster-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. I read the manpage for apt-secure and I am assuming that I am missing the GPG keys, but I did not see anything about this in the Installation Guide. I'm sure that I missed something, somewhere, but I don't know what. I also don't understand why it says that it could not create temporary files in /tmp. I
Re: [Progress Report1] Re: Using debootstrap
On 04/29/2018 07:11 AM, Andy Smith wrote: Hi Richard, On Sun, Apr 29, 2018 at 06:43:42AM -0500, Richard Owlett wrote: On 04/29/2018 12:59 AM, Richard Owlett wrote: On 04/28/2018 10:57 PM, Kushal Kumaran wrote: You can try it out to verify after you fix the mount options to not include nodev. […] The man page for mount hints its possible to remove nodev but there is a dearth of useful examples. # mount -o remount,dev /dev/sdc1 "man mount" says: If you want to override mount options from /etc/fstab you have to use the -o option: mount device|dir -o options That got me further :} But still nothing got written to target :{ I have a secondary machine on which I've made space for a Debian install and a target partition. >50 years of trouble shooting has taught me to eliminate as many unknowns as possible. The primary reason I was using the flash drive was I could not make enough space on this hard drive. as regards "remount" option it later says: remount Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writable. It does not change device or mount point. Also have not found a good description of "nodev". Same man page: devInterpret character or block special devices on the filesystem. nodev Do not interpret character or block special devices on the file system. While a filesystem is mounted "nodev", it can't have device special files created on it. I had read, but not understood, those passages. As I've said on occasion, "If retirement isn't for learning, what use is it?" ;/ Thanks Cheers, Andy
Re: [Progress Report1] Re: Using debootstrap
Hi Richard, On Sun, Apr 29, 2018 at 06:43:42AM -0500, Richard Owlett wrote: > On 04/29/2018 12:59 AM, Richard Owlett wrote: > >On 04/28/2018 10:57 PM, Kushal Kumaran wrote: > >>You can try it out to verify after you fix the mount options to not > >>include nodev. […] > The man page for mount hints its possible to remove nodev but there is a > dearth of useful examples. # mount -o remount,dev /dev/sdc1 "man mount" says: If you want to override mount options from /etc/fstab you have to use the -o option: mount device|dir -o options as regards "remount" option it later says: remount Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writable. It does not change device or mount point. > Also have not found a good description of "nodev". Same man page: devInterpret character or block special devices on the filesystem. nodev Do not interpret character or block special devices on the file system. While a filesystem is mounted "nodev", it can't have device special files created on it. Cheers, Andy -- https://bitfolk.com/ -- No-nonsense VPS hosting
Re: [Progress Report1] Re: Using debootstrap
On 04/29/2018 12:59 AM, Richard Owlett wrote: On 04/28/2018 10:57 PM, Kushal Kumaran wrote: Richard Owlettwrites: On 04/27/2018 12:06 PM, Felix Dietrich wrote: [SNIP] Script started on Fri 27 Apr 2018 02:22:42 PM CDT ls -Rdl /media/root/rco1 ls -Rdl /usr/sbin/debootstrap ls -Rdl /media/root/rco1 debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ exit root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /usr/sbin/debootstrap -rwxr-xr-x 1 root root 18981 Mar 10 2017 /usr/sbin/debootstrap root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ /usr/sbin/debootstrap: 1454: /usr/sbin/debootstrap: cannot create /media/root/rco1/test-dev-null: Permission denied E: Cannot install into target '/media/root/rco1' mounted with noexec or nodev root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# exit exit Script done on Fri 27 Apr 2018 02:22:42 PM CDT The error says the filesystem containing /media/root/rco1 is mounted with noexec or nodev. Is that in fact the case? I don't know. > Look at the /proc/mounts entry for that mountpoint. I used Caja (MATE's file manager) to look at /proc/mounts without finding anything resembling the needed information. I'm missing some understanding. mount -l gives /dev/sdc1 on /media/richard/rco1 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2) [rco1] The operation debootstrap is attempting appears to be the equivalent of mknod /media/root/rco1/test-dev-null c 1 3 You can try it out to verify after you fix the mount options to not include nodev. I started with the man page for "mknod" and followed links 2 or 3 levels discovering how little I know ;/ It's 1 AM my time to quit for "day". Much reading to do. The man page for mount hints its possible to remove nodev but there is a dearth of useful examples. Also have not found a good description of "nodev".
Re: [Progress Report1] Re: Using debootstrap
On 04/28/2018 10:57 PM, Kushal Kumaran wrote: Richard Owlettwrites: On 04/27/2018 12:06 PM, Felix Dietrich wrote: [SNIP] Do not specify „--print-debs” if you want „debootstrap” to install the packages. *BINGO* Proofreading one's own work is intrinsically error prone ;/ But it doesn't solve all my problems. Captured the session with SCRIPT(1). I haven't yet decoded the permission bits displayed by the "ls -Rdl ..." lines. I don't see the two error messages being consistent with what I *think* I see when using Caja. Yepp, I have some homework to do. ;} Script started on Fri 27 Apr 2018 02:22:42 PM CDT ls -Rdl /media/root/rco1 ls -Rdl /usr/sbin/debootstrap ls -Rdl /media/root/rco1 debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ exit root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /usr/sbin/debootstrap -rwxr-xr-x 1 root root 18981 Mar 10 2017 /usr/sbin/debootstrap root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ /usr/sbin/debootstrap: 1454: /usr/sbin/debootstrap: cannot create /media/root/rco1/test-dev-null: Permission denied E: Cannot install into target '/media/root/rco1' mounted with noexec or nodev root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# exit exit Script done on Fri 27 Apr 2018 02:22:42 PM CDT The error says the filesystem containing /media/root/rco1 is mounted with noexec or nodev. Is that in fact the case? I don't know. Look at the /proc/mounts entry for that mountpoint. I used Caja (MATE's file manager) to look at /proc/mounts without finding anything resembling the needed information. I'm missing some understanding. The operation debootstrap is attempting appears to be the equivalent of mknod /media/root/rco1/test-dev-null c 1 3 You can try it out to verify after you fix the mount options to not include nodev. I started with the man page for "mknod" and followed links 2 or 3 levels discovering how little I know ;/ It's 1 AM my time to quit for "day". Much reading to do. Thanks.
Re: [Progress Report1] Re: Using debootstrap
Richard Owlettwrites: > On 04/27/2018 12:06 PM, Felix Dietrich wrote: >>[SNIP] >> >> Do not specify „--print-debs” if you want „debootstrap” to install the >> packages. > > *BINGO* > Proofreading one's own work is intrinsically error prone ;/ > > But it doesn't solve all my problems. Captured the session with > SCRIPT(1). I haven't yet decoded the permission bits displayed by > the "ls -Rdl ..." lines. I don't see the two error messages being > consistent with what I *think* I see when using Caja. > Yepp, I have some homework to do. ;} > > >> Script started on Fri 27 Apr 2018 02:22:42 PM CDT >> >> ls -Rdl /media/root/rco1 >> >> >> ls -Rdl /usr/sbin/debootstrap >> >> >> ls -Rdl /media/root/rco1 >> >> >> debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase >> --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ >> >> >> exit >> root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 >> drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 >> root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls >> -Rdl /usr/sbin/debootstrap >> -rwxr-xr-x 1 root root 18981 Mar 10 2017 /usr/sbin/debootstrap >> root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls >> -Rdl /media/root/rco1 >> drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 >> root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# >> debootstrap --verbose --arch=i386 --include=apt-get >> --variant=minbase --no-check-gpg stable /media/root/rco1 >> file:media/cdrom0/debian/ >> /usr/sbin/debootstrap: 1454: /usr/sbin/debootstrap: cannot create >> /media/root/rco1/test-dev-null: Permission denied >> E: Cannot install into target '/media/root/rco1' mounted with noexec or nodev >> root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# exit >> exit >> >> Script done on Fri 27 Apr 2018 02:22:42 PM CDT The error says the filesystem containing /media/root/rco1 is mounted with noexec or nodev. Is that in fact the case? Look at the /proc/mounts entry for that mountpoint. The operation debootstrap is attempting appears to be the equivalent of mknod /media/root/rco1/test-dev-null c 1 3 You can try it out to verify after you fix the mount options to not include nodev. -- regards, kushal
Re: [Progress Report1] Re: Using debootstrap
On 04/27/2018 09:54 AM, rhkra...@gmail.com wrote: On Friday, April 27, 2018 10:16:22 AM Richard Owlett wrote: I thought I was doing that. My TARGET is "/media/richard/rco" where "rco" is the label of a partition on the flash drive. Just chiming in from left field: have you mounted that partition? Yes. I've pulled boners like that. But not this time ;/ Thanks
Re: [Progress Report1] Re: Using debootstrap
On 04/27/2018 12:06 PM, Felix Dietrich wrote: [SNIP] Do not specify „--print-debs” if you want „debootstrap” to install the packages. *BINGO* Proofreading one's own work is intrinsically error prone ;/ But it doesn't solve all my problems. Captured the session with SCRIPT(1). I haven't yet decoded the permission bits displayed by the "ls -Rdl ..." lines. I don't see the two error messages being consistent with what I *think* I see when using Caja. Yepp, I have some homework to do. ;} Script started on Fri 27 Apr 2018 02:22:42 PM CDT ls -Rdl /media/root/rco1 ls -Rdl /usr/sbin/debootstrap ls -Rdl /media/root/rco1 debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ exit root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /usr/sbin/debootstrap -rwxr-xr-x 1 root root 18981 Mar 10 2017 /usr/sbin/debootstrap root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# ls -Rdl /media/root/rco1 drwxr-xr-x 3 root root 4096 Apr 27 14:08 /media/root/rco1 root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg stable /media/root/rco1 file:media/cdrom0/debian/ /usr/sbin/debootstrap: 1454: /usr/sbin/debootstrap: cannot create /media/root/rco1/test-dev-null: Permission denied E: Cannot install into target '/media/root/rco1' mounted with noexec or nodev root@debian-jan13:~# root@debian-jan13:~# root@debian-jan13:~# exit exit Script done on Fri 27 Apr 2018 02:22:42 PM CDT
Re: [Progress Report1] Re: Using debootstrap
Richard Owlettwrites: > On 04/25/2018 09:19 AM, Richard Owlett wrote: >> My goal is a very minimalist install to a flash drive. It will NOT >> have GRUB - GRUB on this machine is on a dedicated partition for >> convenience in some of my experiments. > > Doing: > debootstrap --verbose --arch=i386 --include=apt-get \ > --variant=minbase --no-check-gpg --print-debs \ > --keep-debootstrap-dir stable /media/richard/rco \ > file:media/cdrom0/debian/ > > generates no error messages. HOWEVER, very few files are actually > written to the flash drive at /media/richard/rco and a subsequent run > of "debootstrap --second-stage" yields a file not found message. You are providing „--print-debs” as an argument to „debootstrap” which will cause „debootstrap” to print the packages it would install and exit. Here is the manual entry for „--print-debs”: Print the packages to be installed, and exit. Note that a TARGET directory must be specified so debootstrap can download Packages files to determine which packages should be installed, and to resolve dependencies. The TARGET directory will be deleted unless --keep-debootstrap-dir is specified. Do not specify „--print-debs” if you want „debootstrap” to install the packages. Also: if you run debootstrap from the same target architecture (or a very similar one like creating an i386 environment from an amd64 host, I suspect) you do not need to run the second stage manually. -- Felix Dietrich
Re: [Progress Report1] Re: Using debootstrap
Richard Owlett wrote: > The error message when attempting "debootstrap --second-stage" is > "cat: /usr/share/debootstrap/suite: No such file or directory". I don't recall to be using second stage. I just make debootstrap with perhaps architecture and I think it takes the minimal as default. Systems$ ls ARM BUSTER GEOD Geode_Old JESSIE RaspBerryPI SID STRETCH Systems$ ls */usr/share/debootstrap/ BUSTER/usr/share/debootstrap/: functions scripts SID/usr/share/debootstrap/: functions scripts AFAIR all is installed via debootstrap. There is a small chance that before Buster it was installed somehow different, but could be that it is something new with this second stage regards
Re: [Progress Report1] Re: Using debootstrap
On Friday, April 27, 2018 10:16:22 AM Richard Owlett wrote: > I thought I was doing that. My TARGET is "/media/richard/rco" where > "rco" is the label of a partition on the flash drive. Just chiming in from left field: have you mounted that partition?
Re: [Progress Report1] Re: Using debootstrap
On 04/27/2018 08:49 AM, deloptes wrote: Richard Owlett wrote: QUESTION: Has anyone personally used debootstrap to install to a flash drive? I do install in a directory and then copy the content to the flash drive then chroot and make it bootable I was installing to the flash drive because I have less than 1GB available on my hard drive. alternatively you ma install into directory where flash drive is mounted I thought I was doing that. My TARGET is "/media/richard/rco" where "rco" is the label of a partition on the flash drive. and then chroot and make it bootable I'm not that far yet. My immediate goal is for debootstrap to write what would "resemble" a system to the flash drive. The error message when attempting "debootstrap --second-stage" is "cat: /usr/share/debootstrap/suite: No such file or directory". forget not that you need to mount the system related /proc/ etc. this is what I am using mount --make-unbindable -obind /proc/ $SYSTEM/proc/ && \ mount --make-unbindable -obind /dev/ $SYSTEM/dev/ && \ mount --make-unbindable -obind /dev/pts $SYSTEM/dev/pts && \ mount --make-unbindable -obind /run $SYSTEM/run && \ mount --make-unbindable -obind /sys $SYSTEM/sys/ && \ chroot $SYSTEM su - For the umount umount $SYSTEM/proc/ && \ umount $SYSTEM/dev/pts && \ umount $SYSTEM/dev/ && \ umount $SYSTEM/run/ && \ umount $SYSTEM/sys/ regards
Re: [Progress Report1] Re: Using debootstrap
Richard Owlett wrote: > QUESTION: > Has anyone personally used debootstrap to install to a flash drive? I do install in a directory and then copy the content to the flash drive then chroot and make it bootable alternatively you ma install into directory where flash drive is mounted and then chroot and make it bootable forget not that you need to mount the system related /proc/ etc. this is what I am using mount --make-unbindable -obind /proc/ $SYSTEM/proc/ && \ mount --make-unbindable -obind /dev/ $SYSTEM/dev/ && \ mount --make-unbindable -obind /dev/pts $SYSTEM/dev/pts && \ mount --make-unbindable -obind /run $SYSTEM/run && \ mount --make-unbindable -obind /sys $SYSTEM/sys/ && \ chroot $SYSTEM su - For the umount umount $SYSTEM/proc/ && \ umount $SYSTEM/dev/pts && \ umount $SYSTEM/dev/ && \ umount $SYSTEM/run/ && \ umount $SYSTEM/sys/ regards
Re: [Progress Report1] Re: Using debootstrap
On 04/27/2018 08:00 AM, songbird wrote: Richard Owlett wrote: ... QUESTION: Has anyone personally used debootstrap to install to a flash drive? not yet... :) i'm currently having other bigger fish to fry... My environment is: OS is i386 Debian stable DVD is DVD-1 of Debian 9.1.0 Flash drive has a: 4 GB ext2 partition 4 GB swap partition get rid of swap partition and change ext2 to ext4 and use all space on drive for that. Done. No change :{ don't ask me what i think of uefi... when using flash drive on main system you can use the main system drive swap (modify /etc/fstab on flash drive to use main system drive swap). I know. When my first attempt failed I added the swap partition "just in case" debootstrap expected to see it on the destination device. songbird
Re: [Progress Report1] Re: Using debootstrap
Richard Owlett wrote: ... > QUESTION: > Has anyone personally used debootstrap to install to a flash drive? not yet... :) i'm currently having other bigger fish to fry... > My environment is: >OS is i386 Debian stable >DVD is DVD-1 of Debian 9.1.0 >Flash drive has a: > 4 GB ext2 partition > 4 GB swap partition get rid of swap partition and change ext2 to ext4 and use all space on drive for that. don't ask me what i think of uefi... when using flash drive on main system you can use the main system drive swap (modify /etc/fstab on flash drive to use main system drive swap). songbird
Re: [Progress Report1] Re: Using debootstrap
On 04/27/2018 06:38 AM, Richard Owlett wrote: Doing: debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg --print-debs --keep-debootstrap-dir stable /media/richard/rco file:media/cdrom0/debian/ generates no error messages. HOWEVER, very few files are actually written to the flash drive at /media/richard/rco and a subsequent run of "debootstrap --second-stage" yields a file not found message. I have some ideas about my problems and will have time this weekend. I just ran a couple of quick tests of what should be a more typical case with no different results. QUESTION: Has anyone personally used debootstrap to install to a flash drive? My environment is: OS is i386 Debian stable DVD is DVD-1 of Debian 9.1.0 Flash drive has a: 4 GB ext2 partition 4 GB swap partition TIA
[Progress Report1] Re: Using debootstrap
On 04/25/2018 09:19 AM, Richard Owlett wrote: My goal is a very minimalist install to a flash drive. It will NOT have GRUB - GRUB on this machine is on a dedicated partition for convenience in some of my experiments. From reading several references I believe my command should be: debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg --print-debs --keep-debootstrap-dir stable /media/richard/rco /media/cdrom0/ I have two questions: 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my "repository"? 2. As I expect the console display may exceed the scroll back limits, I wish to pipe the console display for later reference without impeding answering any prompts I get. I've seen a description for doing that, but I can't remember it. Pointers? Taking those questions in reverse order ;} SCRIPT(1) was the command I had been trying to recall. I does things in a comfortable way. I was reading man page for SCREEN(1) when SCRIPT(1) was suggested. Part of the recommendation for SCREEN(1) was it being mentioned in the release notes for *upgrades*. In fact the release notes describe using it for _remote_ upgrades, not local new installs via debootstrap. Doing: debootstrap --verbose --arch=i386 --include=apt-get --variant=minbase --no-check-gpg --print-debs --keep-debootstrap-dir stable /media/richard/rco file:media/cdrom0/debian/ generates no error messages. HOWEVER, very few files are actually written to the flash drive at /media/richard/rco and a subsequent run of "debootstrap --second-stage" yields a file not found message. I have some ideas about my problems and will have time this weekend. Thank you.
Re: Using debootstrap
On 04/26/2018 02:43 PM, Henning Follmann wrote: On Thu, Apr 26, 2018 at 08:02:38PM +0200, deloptes wrote: Henning Follmann wrote: Happy to read the man page to you buddy. -H while I can understand your feeling quite well, I had to teach myself either to ignore affecting questions or to answer for the sake of the answer. sometimes it is really frustrating how one can not understand obvious things, however not all are same age, have same background or level of intelligence. its better you give example in such case debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 this is how I understand it, correct if I'm wrong I am no expert on the install ISO images but if I understand correctly there is a "debian" directory on it. So I guess: debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1/debian however just hope that the current DVD is also "stable" The purchased DVD is Debian 9.1.0. My OS used is stable installed via netinst.
Re: Using debootstrap
On 04/26/2018 02:39 PM, Felix Dietrich wrote: deloptes <delop...@gmail.com> writes: its better you give example in such case debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 this is how I understand it, correct if I'm wrong Almost: as has been stated elsewhere in this thread, at least according to Appendix D of the Debian Installation Guide [1] you may provide a „file://” URL to the debian/ directory below the mount point of the disc for the MIRROR parameter, e.g.: file:///cdrom/debian/ Admittedly, I have not to tested either this or your variant. [1] https://www.debian.org/releases/stable/i386/apds03.html.en#idm46014282700896 Apparently file:media/cdrom0/debian/ work. I say "apparently" because: 1. I get no "file not found" messages. 2. I have some undiagnosed problems using debootstrap.
Re: Using debootstrap
On Thu 26 Apr 2018 at 15:43:32 (-0400), Henning Follmann wrote: > On Thu, Apr 26, 2018 at 08:02:38PM +0200, deloptes wrote: > > Henning Follmann wrote: > > > > > Happy to read the man page to you buddy. > > > > > > > > > -H > > > > while I can understand your feeling quite well, I had to teach myself either > > to ignore affecting questions or to answer for the sake of the answer. > > > > sometimes it is really frustrating how one can not understand obvious > > things, however not all are same age, have same background or level of > > intelligence. > > > > its better you give example in such case > > > > debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 > > > > this is how I understand it, correct if I'm wrong > > > > I am no expert on the install ISO images but if I understand correctly > there is a "debian" directory on it. So I guess: > debootstrap [OPTION...] stable /mypath/to/target/installation > file:///DVD1/debian > > however just hope that the current DVD is also "stable" I haven't used a full CD/DVD for years, only netinst, so I'm reduced to guessing like everyone else here. My guess is a simple file:///media/cdrom0/ If the usual link is there, then file:///media/cdrom/ would be as good. Justifications: netinst has top level directories like .disk/, dists/ and pool/, and a README.html file which corresponds to what's outlined at the start of https://www.debian.org/CD/faq/ The build log for the 14 disk set at https://cdimage.debian.org/debian-cd/current/amd64/log/20180310/ contains lines like these three: libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can only be added to a Rock Ridge tree. libisofs: WARNING : Cannot add /dists/stable to Joliet tree. Symlinks can only be added to a Rock Ridge tree. libisofs: WARNING : File "/pool/main/g/golang-github-shurcool-sanitized-anchor-name/golang-github-shurcool-sanitized-anchor-name-dev_0.0~git20160918.0.1dba4b3-1_all.deb" can't be added to Joliet tree, because its path length is larger than 240 which imply that pool is top-level, and that debian is a symlink which would almost certainly point to ./ and likewise dists/stable would point to dists/stretch (but netinst doesn't bother with these symlinks). Cheers, David.
Re: Using debootstrap
delopteswrites: > its better you give example in such case > > debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 > > this is how I understand it, correct if I'm wrong Almost: as has been stated elsewhere in this thread, at least according to Appendix D of the Debian Installation Guide [1] you may provide a „file://” URL to the debian/ directory below the mount point of the disc for the MIRROR parameter, e.g.: file:///cdrom/debian/ Admittedly, I have not to tested either this or your variant. [1] https://www.debian.org/releases/stable/i386/apds03.html.en#idm46014282700896 -- Felix Dietrich
Re: Using debootstrap
On Thu, Apr 26, 2018 at 08:02:38PM +0200, deloptes wrote: > Henning Follmann wrote: > > > Happy to read the man page to you buddy. > > > > > > -H > > while I can understand your feeling quite well, I had to teach myself either > to ignore affecting questions or to answer for the sake of the answer. > > sometimes it is really frustrating how one can not understand obvious > things, however not all are same age, have same background or level of > intelligence. > > its better you give example in such case > > debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 > > this is how I understand it, correct if I'm wrong > I am no expert on the install ISO images but if I understand correctly there is a "debian" directory on it. So I guess: debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1/debian however just hope that the current DVD is also "stable" -H -- Henning Follmann | hfollm...@itcfollmann.com
Re: Using debootstrap
Henning Follmann wrote: > Happy to read the man page to you buddy. > > > -H while I can understand your feeling quite well, I had to teach myself either to ignore affecting questions or to answer for the sake of the answer. sometimes it is really frustrating how one can not understand obvious things, however not all are same age, have same background or level of intelligence. its better you give example in such case debootstrap [OPTION...] stable /mypath/to/target/installation file:///DVD1 this is how I understand it, correct if I'm wrong regards
Re: Using debootstrap
On 2018-04-25, Richard Owlettwrote: > My goal is a very minimalist install to a flash drive. It will NOT have > GRUB - GRUB on this machine is on a dedicated partition for convenience > in some of my experiments. > > From reading several references I believe my command should be: > > debootstrap --arch=i386 --include=apt-get --variant=minbase > --no-check-gpg --print-debs --keep-debootstrap-dir stable > /media/richard/rco /media/cdrom0/ > I have two questions: >1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 > as my "repository"? https://www.debian.org/releases/stable/amd64/apds03.html.en "if you have a stretch Debian GNU/Linux CD mounted at /cdrom, you could substitute a file URL instead of the http URL: file:/cdrom/debian/" so if this info isn't obsolete, in your case, I dunno: file:/media/cdrom0/debian/ ? >2. As I expect the console display may exceed the scroll back limits, > I wish to pipe the console display for later reference without > impeding answering any prompts I get. I've seen a description for > doing that, but I can't remember it. Pointers? > > -- "Three prisoners were locked in a cell. When the largest of them finished his food, he immediately ate the others. Too bad. An apostrophe in the right place might have prevented a horrible crime." Joe Gunn
Re: Using debootstrap
On Wednesday, April 25, 2018 03:17:40 PM Richard Owlett wrote: > How does one search for some concept for which you have no keywords? Well: * think about it, even some phrases if not keywords * describe what you are looking for here--maybe someone can help you with some keywords (but, start a new thread, as what you're looking for is presumably not related to Using debootstrap
Re: Using debootstrap
On 04/25/2018 11:03 AM, Greg Wooledge wrote: ... I meant a script(1) session. Sorry. But I bet screen also has some logging capabilities, if you want to do it that way. As the man page says: It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, ... Just the tool, though screen(1) may be useful for other projects. Thanks.
Re: Using debootstrap
On 04/25/2018 10:47 AM, Greg Wooledge wrote: On Wed, Apr 25, 2018 at 06:45:32PM +0300, Abdullah Ramazanoglu wrote: On Wed, 25 Apr 2018 09:19:13 -0500 Richard Owlett said: I have two questions: 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my "repository"? 2. As I expect the console display may exceed the scroll back limits, I wish to pipe the console display for later reference without impeding answering any prompts I get. I've seen a description for doing that, but I can't remember it. Pointers? No idea about (1), but for (2) you can use this: ~# command 2>&1 | tee command.log With "tee" you create/squash the output file anew. With "tee -a" you append to it. Or run the commands inside a screen(1) session. That's what the release notes advise for distribution upgrades. I've just browsed the first few paragraphs of the man page. It looks fascinating. Will have to experiment. Thank you.
Re: Using debootstrap
On 04/25/2018 10:45 AM, Abdullah Ramazanoglu wrote: On Wed, 25 Apr 2018 09:19:13 -0500 Richard Owlett said: I have two questions: 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my "repository"? 2. As I expect the console display may exceed the scroll back limits, I wish to pipe the console display for later reference without impeding answering any prompts I get. I've seen a description for doing that, but I can't remember it. Pointers? No idea about (1), but for (2) you can use this: ~# command 2>&1 | tee command.log With "tee" you create/squash the output file anew. With "tee -a" you append to it. Regards That's what I had seen. Thank you. How does one search for some concept for which you have no keywords? TIA
Re: Using debootstrap
Henning Follmannwrites: > On Wed, Apr 25, 2018 at 09:19:13AM -0500, Richard Owlett wrote: >> From reading several references I believe my command should be: >> >> debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg >> --print-debs --keep-debootstrap-dir stable /media/richard/rco >> /media/cdrom0/ >> >> I have two questions: >> 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 >> as my "repository"? > > How about man debootstrap? > > I'll copy the synopsys for you(r lazy ...) here > debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] > > after stable you provide the target (your usb stick) Am I misunderstanding you here? Your answer seems unnecessarily curt and actually misses his question (the question marks he used to indicate his point of confusion are at the MIRROR parameter). Even if he had been confused about the usage of the TARGET parameter he deserved a more polite and helpful answer because, as you have just experienced, sometimes one misunderstands, what has been written. Maybe I am just to sensitive, though. -- Felix Dietrich
Re: Using debootstrap
> From reading several references I believe my command should be: > > debootstrap --arch=i386 --include=apt-get --variant=minbase \ > --no-check-gpg --print-debs --keep-debootstrap-dir stable \ > /media/richard/rco /media/cdrom0/ > What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my > "repository"? Have a look at the Debian GNU/Linux Installation Guide under Appendix D [1]. The guide suggests that you can use a cdrom mounted on /cdrom by providing a file URL for the MIRROR parameter: file:///cdrom/debian/ . The same might work for an installation DVD. > 2. As I expect the console display may exceed the scroll back limits, > I wish to pipe the console display for later reference without > impeding answering any prompts I get. I've seen a description for > doing that, but I can't remember it. Pointers? The _tee_ program writes output passed to it over STDIN both to its STDOUT (the terminal) and a file provided as an argument: debootstrap … | tee /tmp/debootstrap.output Though by piping the output to _tee_ graphical prompts will no longer work. You could also just increase your scrollback buffer size or use a screen multiplexer, like _tmux_, if your terminal emulator does not allow setting an high enough value. [1] https://www.debian.org/releases/stable/i386/apds03.html.en#idm46014282700896 -- Felix Dietrich
Re: Using debootstrap
... I meant a script(1) session. Sorry. But I bet screen also has some logging capabilities, if you want to do it that way.
Re: Using debootstrap
On Wed, Apr 25, 2018 at 06:45:32PM +0300, Abdullah Ramazanoglu wrote: > On Wed, 25 Apr 2018 09:19:13 -0500 Richard Owlett said: > > > I have two questions: > >1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 > > as my "repository"? > >2. As I expect the console display may exceed the scroll back limits, > > I wish to pipe the console display for later reference without > > impeding answering any prompts I get. I've seen a description for > > doing that, but I can't remember it. Pointers? > > No idea about (1), but for (2) you can use this: > > ~# command 2>&1 | tee command.log > > With "tee" you create/squash the output file anew. With "tee -a" you append to > it. Or run the commands inside a screen(1) session. That's what the release notes advise for distribution upgrades.
Re: Using debootstrap
On Wed, 25 Apr 2018 09:19:13 -0500 Richard Owlett said: > I have two questions: >1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 > as my "repository"? >2. As I expect the console display may exceed the scroll back limits, > I wish to pipe the console display for later reference without > impeding answering any prompts I get. I've seen a description for > doing that, but I can't remember it. Pointers? No idea about (1), but for (2) you can use this: ~# command 2>&1 | tee command.log With "tee" you create/squash the output file anew. With "tee -a" you append to it. Regards -- Abdullah Ramazanoglu
Re: Using debootstrap
On Wed, Apr 25, 2018 at 10:21:21AM -0500, Richard Owlett wrote: > On 04/25/2018 10:12 AM, Henning Follmann wrote: > > On Wed, Apr 25, 2018 at 09:19:13AM -0500, Richard Owlett wrote: > > > My goal is a very minimalist install to a flash drive. It will NOT have > > > GRUB > > > - GRUB on this machine is on a dedicated partition for convenience in some > > > of my experiments. > > > > > > From reading several references I believe my command should be: > > > > > > debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg > > > --print-debs --keep-debootstrap-dir stable /media/richard/rco > > > /media/cdrom0/ > > > > > > I have two questions: > > >1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 > > > as my "repository"? > > >2. As I expect the console display may exceed the scroll back limits, > > > I wish to pipe the console display for later reference without > > > impeding answering any prompts I get. I've seen a description for > > > doing that, but I can't remember it. Pointers? > > > > > > > How about > > man debootstrap > > ? > > > > I'll copy the synopsys for you(r lazy ...) here > >debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] > > > > after stable you provide the target (your usb stick) > > > > > Two problems with with your answer > 1. the man page was one of my half-dozen references. > 2. you answered neither of my questions. > > > > What did you not understand in the man page? can I continue copying stuff from the man page to you: debootstrap bootstraps a basic Debian system of SUITE into TARGET from MIRROR by running SCRIPT. MIRROR can be an http:// or https:// URL, a file:/// URL, or an ssh:/// URL. if you don't provide a Mirror it will consult your sources list. Happy to read the man page to you buddy. -H -- Henning Follmann | hfollm...@itcfollmann.com
Re: Using debootstrap
On 04/25/2018 10:12 AM, Henning Follmann wrote: On Wed, Apr 25, 2018 at 09:19:13AM -0500, Richard Owlett wrote: My goal is a very minimalist install to a flash drive. It will NOT have GRUB - GRUB on this machine is on a dedicated partition for convenience in some of my experiments. From reading several references I believe my command should be: debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg --print-debs --keep-debootstrap-dir stable /media/richard/rco /media/cdrom0/ I have two questions: 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my "repository"? 2. As I expect the console display may exceed the scroll back limits, I wish to pipe the console display for later reference without impeding answering any prompts I get. I've seen a description for doing that, but I can't remember it. Pointers? How about man debootstrap ? I'll copy the synopsys for you(r lazy ...) here debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] after stable you provide the target (your usb stick) Two problems with with your answer 1. the man page was one of my half-dozen references. 2. you answered neither of my questions.
Re: Using debootstrap
On Wed, Apr 25, 2018 at 09:19:13AM -0500, Richard Owlett wrote: > My goal is a very minimalist install to a flash drive. It will NOT have GRUB > - GRUB on this machine is on a dedicated partition for convenience in some > of my experiments. > > From reading several references I believe my command should be: > > debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg > --print-debs --keep-debootstrap-dir stable /media/richard/rco > /media/cdrom0/ > > I have two questions: > 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 > as my "repository"? > 2. As I expect the console display may exceed the scroll back limits, > I wish to pipe the console display for later reference without > impeding answering any prompts I get. I've seen a description for > doing that, but I can't remember it. Pointers? > How about man debootstrap ? I'll copy the synopsys for you(r lazy ...) here debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] after stable you provide the target (your usb stick) -H -- Henning Follmann | hfollm...@itcfollmann.com
Using debootstrap
My goal is a very minimalist install to a flash drive. It will NOT have GRUB - GRUB on this machine is on a dedicated partition for convenience in some of my experiments. From reading several references I believe my command should be: debootstrap --arch=i386 --include=apt-get --variant=minbase --no-check-gpg --print-debs --keep-debootstrap-dir stable /media/richard/rco /media/cdrom0/ I have two questions: 1. What should replace "" as I'll be using DVD1 of Debian 9.1.0 as my "repository"? 2. As I expect the console display may exceed the scroll back limits, I wish to pipe the console display for later reference without impeding answering any prompts I get. I've seen a description for doing that, but I can't remember it. Pointers?
RE: locale problem when setting up a chroot using debootstrap
-Original Message- From: andy baxter [mailto:a...@earthsong.free-online.co.uk] Sent: Sunday, August 16, 2009 2:28 PM To: debian-user@lists.debian.org Subject: locale problem when setting up a chroot using debootstrap I'm setting up a chroot using debootstrap, eventually for use with user mode linux. I have got it mostly working ok, but when I install some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error message because it's on another machine and that filesystem has just died so I'll have to rebuild it before I can reproduce the error). Is there some package I need to install inside the chroot? Thanks, andy baxter You need the locales package, which may not be automatically installed by debootstrap. If it is installed, simply running dpkg-reconfigure locales should be enough to make the messages go away. Hope this helps! -- Kevin -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: locale problem when setting up a chroot using debootstrap
Thanks a lot. I was trying to find something like that using dpkg -l and apt-cache search, but obviously missed it. Cheers, andy Kevin Ross wrote: -Original Message- From: andy baxter [mailto:a...@earthsong.free-online.co.uk] Sent: Sunday, August 16, 2009 2:28 PM To: debian-user@lists.debian.org Subject: locale problem when setting up a chroot using debootstrap I'm setting up a chroot using debootstrap, eventually for use with user mode linux. I have got it mostly working ok, but when I install some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error message because it's on another machine and that filesystem has just died so I'll have to rebuild it before I can reproduce the error). Is there some package I need to install inside the chroot? Thanks, andy baxter You need the locales package, which may not be automatically installed by debootstrap. If it is installed, simply running dpkg-reconfigure locales should be enough to make the messages go away. Hope this helps! -- Kevin -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: locale problem when setting up a chroot using debootstrap
On Mon, Aug 17, 2009 at 07:31:04AM +0100, andy baxter wrote: Thanks a lot. I was trying to find something like that using dpkg -l and apt-cache search, but obviously missed it. some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error I do not know your version but I remember perl used to print useless warnings if they are not run under LANG=C. I.e. en_GB.UTF-8 could be the source of issue. You can quiet them by running program as # LANG=C somecommand Osamu -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: locale problem when setting up a chroot using debootstrap
Osamu Aoki wrote: On Mon, Aug 17, 2009 at 07:31:04AM +0100, andy baxter wrote: Thanks a lot. I was trying to find something like that using dpkg -l and apt-cache search, but obviously missed it. some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error I do not know your version but I remember perl used to print useless warnings if they are not run under LANG=C. I.e. en_GB.UTF-8 could be the source of issue. You can quiet them by running program as # LANG=C somecommand I think this is the problem. I tried installing locales and it didn't help. The message that comes up mentions en_GB.UTF-8. Running perl with LANG=C does suppress the warning, so I should be able to sort it out from there. cheers, andy -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: locale problem when setting up a chroot using debootstrap
On 2009-08-17 17:55 +0200, andy baxter wrote: Osamu Aoki wrote: On Mon, Aug 17, 2009 at 07:31:04AM +0100, andy baxter wrote: Thanks a lot. I was trying to find something like that using dpkg -l and apt-cache search, but obviously missed it. some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error I do not know your version but I remember perl used to print useless warnings if they are not run under LANG=C. I.e. en_GB.UTF-8 could be the source of issue. You can quiet them by running program as # LANG=C somecommand I think this is the problem. I tried installing locales and it didn't help. You also need to run dpkg-reconfigure locales and select the locale(s) that you are using outside the chroot. The message that comes up mentions en_GB.UTF-8. Running perl with LANG=C does suppress the warning, so I should be able to sort it out from there. Setting LANG=C (or LC_ALL=C) is always an alternative of course. Sven -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
locale problem when setting up a chroot using debootstrap
I'm setting up a chroot using debootstrap, eventually for use with user mode linux. I have got it mostly working ok, but when I install some packages (e.g. mc), there are a load of errors which seem to be to do with locales. Perl (I think) is saying something like check that the right locale is installed for the language code you have configured (en-GB). (Its hard at the moment to give the exact error message because it's on another machine and that filesystem has just died so I'll have to rebuild it before I can reproduce the error). Is there some package I need to install inside the chroot? Thanks, andy baxter -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Installing Lenny on LVM using debootstrap
Boyd Stephen Smith Jr. wrote: In 4a125119.8030...@yahoo.com, Marc Shapiro wrote: I then chrooted into /mnt/debinst, again, and did: cd \dev MAKEDEV generic Instead of this, since you have a running Linux system, I would suggest doing (from outside the chroot): mount -o rbind /dev /mnt/debinst/dev Thanks, that did it. The devices all show up now. I installed lvm2 in the chroot then exited and unmounted them from outside the chroot. After reentering, I was able to do a mount -a and everything looks as it should. That is probably what I have done before, but the current docs only say that it can be done, not what the actual command is. They also recommend against it. I suppose that is because the base system is not guaranteed to be linux, but still... -- Marc Shapiro mshapiro...@yahoo.com -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Installing Lenny on LVM using debootstrap
In 4a140dad.6020...@yahoo.com, Marc Shapiro wrote: Boyd Stephen Smith Jr. wrote: In 4a125119.8030...@yahoo.com, Marc Shapiro wrote: I then chrooted into /mnt/debinst, again, and did: cd \dev MAKEDEV generic Instead of this, since you have a running Linux system, I would suggest doing (from outside the chroot): mount -o rbind /dev /mnt/debinst/dev That is probably what I have done before, but the current docs only say that it can be done, not what the actual command is. They also recommend against it. That's probably because the bind mount gives the chroot significant access to the host. Specifically, unlinking a device from /dev inside the chroot will also unlink it from /dev outside the chroot, which could cause problems. I don't mind doing the mind mount, because much more destructive acts can be done as root inside the chroot if you don't have the filesystem it is on mounted 'nodev' and doing that generally results in a non-functional chroot. As far as destructive acts, I'm thinking mknod for every possible hd*, sd*, md*, and dm* device plus urandom and then writing the contents of urandom over all the other devices. chroots are only as secure as your method of dropping permissions after doing the chroot() system interface call. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Installing Lenny on LVM using debootstrap
I have given up on trying to get flash working again on my existing system. I have decided, since I have a spare partition with LVM volumes for /home, /var, /usr, /tmp, and swap that I would just reformat them with mke2fs -j and reinstall using debootstrap into these volumes. I followed the instruction in Appendix D of the installation manual, but they seem to have changed since I installed Lenny the first time (and Etch, before that) and there is no mention of how to install on LVM volumes. Here is what I have done: I reformatted: /dev/hda1(for /) /dev/vg0/tmp /dev/vg0/usr /dev/vg0/var /dev/vg0/home I did: mkswap /dev/vg0/swap sync;sync;sync swapon /dev/vg0/swap I mounted /dev/hda1 on /mnt/debinst I chrooted into /mnt/debinst I made mountpoints for: /tmp /var /usr /home I exited the chroot I mounted: /dev/vg0/tmp on /mnt/debinst/tmp /dev/vg0/var on /mnt/debinst/var /dev/vg0/usr on /mnt/debinst/usr /dev/vg0/home on /mnt/debinst/home I used debootstrap --arch ARCH lenny \ /mnt/debinst http://ftp.us.debian.org/debian to install the base system. I then chrooted into /mnt/debinst, again, and did: cd \dev MAKEDEV generic The instructions then say to create /etc/fstab and mount your partitions. It tried that, but I can not access the LVM volumes to mount them within the chroot. I seem to have everything that should have been installed (150+ screens of files from ls -R /usr), but df says that I have only used 9% of 280003 blocks of sysfs mounted on /sys. Nothing else is shown. Can I just install lvm2 from within the chroot? Will that allow me, then, to mount the volumes? Do I want to mount the LVM volumes, since it seems that everything is available. But then, what happens once I have everything ready to reboot into the new partitions if I can't mount the volumes then? I don't remember having this problem when I initially installed Lenny, which was also done through a debootstrap chroot. Are there instructions somewhere for doing the install onto LVM volumes? I REALLY want to get a system with working flash. So does my daughter! Help! Please. -- Marc Shapiro mshapiro...@yahoo.com -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: Installing Lenny on LVM using debootstrap
In 4a125119.8030...@yahoo.com, Marc Shapiro wrote: I then chrooted into /mnt/debinst, again, and did: cd \dev MAKEDEV generic Instead of this, since you have a running Linux system, I would suggest doing (from outside the chroot): mount -o rbind /dev /mnt/debinst/dev That wouldn't work if you were trying to install Debian from (e.g.) AIX, HP- UX, or NCR UNIX, but, in that case, you'd have to reboot into Linux to access the Linux LVM2 logical volumes anyway. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: using debootstrap to install Debian
On Mon, 2008-07-07 at 20:11 -0300, Gabriel Parrondo wrote: El lun, 07-07-2008 a las 22:54 +0100, michael escribió: On Fri, 2008-07-04 at 17:56 -0300, Gabriel Parrondo wrote: El vie, 04-07-2008 a las 17:24 +0200, Shawn Beasley escribió: michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) OP is not using/installing ubuntu, he's installing debian and using fedora. I don't see where ubuntu fits. /vmlinuz and /initrd are links to files in /boot, which are installed by the kernel package (actually, the initrd is created, not installed). OP: You should chroot in /debian_chroot and run 'aptitude install linux-image-architecture'. If debootstrap didn't already, also install grub (or lilo if you prefer it). Edit fstab (don't forget about /proc) and exit the chroot. Then, if you have grub in the fedora system, run 'grub-install --root-directory=/debian_chroot /dev/device' and edit /debian_chroot/boot/grub/device.map if necessary. Re-enter the chroot and run update-grub. Then make the bios boot from that device, however you do it, and there you go. thanks, that sounds str forward - presumably the 'grub-install' will write a new MBR so when I reboot the machine it looks in /debian_chroot (ie I won't see the options from my [Fedora] /boot/grub/menu.lst)? That's what the --root-directory parameter does. (I'm wanting to be able to boot into Debian kernel, but if it screws up be able to go back into Fedora, and then, finally when got a working Debian, wipe the Fedora and have a Debian (only) system) Check the default and savedefault options in grub's menu.lst. Basically, you use them to tell grub boot the default menu item, but before you do, set this menu entry as default for next reboot(s) also wanted to check there's no prob if /debian_chroot (and others) are on a LVM? -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
David Barrett wrote: Aha, excellent -- with your grub commands I was able to complete my script. Thanks for bringing this up. (Though I'm still not sure where the stage1/2/e2fs_stage1 should come from -- currently it just copies off the host, which isn't that clean but works for now.) I have no exact knowledge how GRUB is implemented by I would bet on what those filenames suggest. They are pieces of codes for various stages during grub startup. Note that /boot/grub/stage1 has 512 bytes so that it fits to a single block. Of course, that code cannot due to size constraints but it obviously succeeds in pulling into memory the following stage. Grub must understand particular filesystem to be able to locate kernels on the physical disk so obviously this cannot be implemented within first 512 bytes. Therefore multiple phases. Those are (non-ELF) executable binaries thus some care must be taken when reusing them within QEMU but as long as your PC and QEMU are both i386 (non Spark, non Alpha etc) I think it makes sense that those binaries created for i386 real mode are reusable. The grub itself switches to protected mode before it gives control to the kernel. I've posted it on my blog and will keep updating it here: http://blog.quinthar.com/2008/07/building-1gb-bootable-qemu-image-using.html As for the magic numbers in the script to make it work for 1GB, here's how I came up with them for the dd command: bs = blocksize = 1024 count = 1GB/bs = (1024*1024*1024)/1024 = 1048576 Ok. I have looked at it and this make sense. The partition cannot start at the very begining of the disk (the very first disk block) block because it would overlap with MBR. The fdisk shows that the partition created this way starts at block 32. Blocks are of 512 byte size. The partition we create this way is thus indeed offset to 32 * 512 = 16384 For the parted command, I got the numbers by installing with the netinst ISO onto a 1GB raw file, and then doing parted test.raw print. I don't know how the netinst installer came up with those numbers, but I just copied them. Regardless, it seems like you can pretty much choose whatever you want; I'm sure there's a whole science behind it. (Where the 1069 came from I have no idea, as there are only 1024 MB on disk.) For the loop,offset=16384 that took some guesswork: parted print spit out 16.4K as the start of the first partition, and I guessed that it was just rounding off 16384 and it worked. Regardless, here it is for those of you following along. Thanks for all your help! -david Have a good day. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
On Mon, 2008-07-07 at 20:11 -0300, Gabriel Parrondo wrote: {} OP: You should chroot in /debian_chroot and run 'aptitude install linux-image-architecture'. If debootstrap didn't already, also install grub (or lilo if you prefer it). Edit fstab (don't forget about /proc) and exit the chroot. Then, if you have grub in the fedora system, run 'grub-install --root-directory=/debian_chroot /dev/device' and edit /debian_chroot/boot/grub/device.map if necessary. Re-enter the chroot and run update-grub. Then make the bios boot from that device, however you do it, and there you go. thanks, that sounds str forward - presumably the 'grub-install' will write a new MBR so when I reboot the machine it looks in /debian_chroot (ie I won't see the options from my [Fedora] /boot/grub/menu.lst)? That's what the --root-directory parameter does. (I'm wanting to be able to boot into Debian kernel, but if it screws up be able to go back into Fedora, and then, finally when got a working Debian, wipe the Fedora and have a Debian (only) system) Check the default and savedefault options in grub's menu.lst. Basically, you use them to tell grub boot the default menu item, but before you do, set this menu entry as default for next reboot(s) Ah, so there will be a new MBR, it will point to /debian_chroot for Debian linux but still keep the old Fedora paths... I was thinking the old grub/menu.lst would have been lost during 'grub-install' (which I can't recall ever using before - have editted menu.lst many a time...) thanks, M -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
OP: You should chroot in /debian_chroot and run 'aptitude install linux-image-architecture'. If debootstrap didn't already, also install grub (or lilo if you prefer it). Edit fstab (don't forget about /proc) and exit the chroot. Then, if you have grub in the fedora system, run 'grub-install --root-directory=/debian_chroot /dev/device' and edit /debian_chroot/boot/grub/device.map if necessary. Re-enter the chroot and run update-grub. Then make the bios boot from that device, however you do it, and there you go. thanks, that sounds str forward - presumably the 'grub-install' will write a new MBR so when I reboot the machine it looks in /debian_chroot (ie I won't see the options from my [Fedora] /boot/grub/menu.lst)? That's what the --root-directory parameter does. I'm being doubly (if not triply!) dense today: apologies! Can I just copy (Fedora's) /etc/fstab, see below, to /debian_chroot? [EMAIL PROTECTED] grub]# cat /etc/fstab /dev/VolGroup00/LogVol00 / ext3defaults 1 1 LABEL=/boot /boot ext3defaults 1 2 tmpfs /dev/shmtmpfs defaults 0 0 devpts /dev/ptsdevpts gid=5,mode=620 0 0 sysfs /syssysfs defaults 0 0 proc/proc procdefaults 0 0 /dev/VolGroup00/LogVol01 swapswapdefaults 0 0 ### MKB (Sept 2007): 750Gb disk #/dev/sdb1 /WinXP ntfsdefaults0 2 /dev/sdb2/data1 ext3 defaults,errors=remount-ro 0 2 ### MKB (Sept 2007): nfs4 mount ratty:~michael for user mkb ratty.phy.umist.ac.uk:/home/michael /home/mkb/ratty nfs hard,intr 0 0 ### MKB (Apr 2008): CIFS mount CG-drives # NB credentials file can only contain username and/or password //cg-drives.rcs.manchester.ac.uk/mccssmb2 /mnt/CG cifs uid=1000,gid=1000,file_mode=0600,dir_mode=0700,credentials=/home/mkb/cg_cred.txt 0 0 ### MKB (Jul 2008): mount new partition for Debian chroot /dev/VolGroup00/debian /debian_chroot ext3defaults 1 2 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
David Barrett wrote: Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? You may be able to get grub-install to work using the --grub-mkdevicemap option and a dummied up device map that points to the disk image. echo Creating 1GB file of zeros in $1.raw dd if=/dev/zero of=$1.raw bs=1024 count=1048576 But wouldn't it be easier to stop here and run: qemu -cdrom mini.iso -hda $1.raw -boot c (Downloading an appropriate d-i mini.iso or other iso first.) -- see shy jo signature.asc Description: Digital signature
Re: How to create qemu-bootable image using debootstrap?
Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? -david -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
Joey Hess wrote: David Barrett wrote: Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? You may be able to get grub-install to work using the --grub-mkdevicemap option and a dummied up device map that points to the disk image. Ah, this sounds good -- can you give me any more detail on this? I'm not finding anything particularly good with my own searches. I've read the wiki page: http://wiki.debian.org/Grub/grub-mkdevicemap.manpage But I'm not quite sure where to go next. You see the script I'm working on; can you propose a next step? If it helps, I can copy /boot/grub/device.map from a working/bootable QEMU image. But I don't know what to do with it. Can you offer me any suggestions? echo Creating 1GB file of zeros in $1.raw dd if=/dev/zero of=$1.raw bs=1024 count=1048576 But wouldn't it be easier to stop here and run: qemu -cdrom mini.iso -hda $1.raw -boot c (Downloading an appropriate d-i mini.iso or other iso first.) Heh, what fun would that be! -david -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? If I recall correctly, qemu can boot a linux kernel directly so you *probably* don't need grub. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) signature.asc Description: Digital signature
Re: How to create qemu-bootable image using debootstrap?
Andrei Popescu wrote: On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? If I recall correctly, qemu can boot a linux kernel directly so you *probably* don't need grub. Aha! I completely forgot about those options. This works great: sudo qemu -kernel-kqemu -kernel newtest.mount/boot/vmlinuz-2.6.18-6-486 -append root=/dev/hda1 ro -initrd newtest.mount/boot/initrd.img-2.6.18-6-486 newtest.raw It makes the command line a bit awkward, but does the trick. This is great workaround, thanks! That said, if possible, I'd still like to get grub installed to make it self-contained and boot up like normal (else I need to update all the startup scripts to be aware of the exact kernel version). One way would be to boot the VM with the above trick and then install grub from the inside... but there's *got* to be a way to install it from the outside, straight into the raw image. Joey's idea of grub-mkdevicemap sounds good; I'll need to look into that more. Thanks everyone for all the help! -david -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
On Mon, Jul 07, 2008 at 10:41:30AM +0300, Andrei Popescu wrote: On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? If I recall correctly, qemu can boot a linux kernel directly so you *probably* don't need grub. That's where I was leading. I don't know qemu, but I do recall, for instance, loadlin, and made a mental analogy. -- Carl Fink [EMAIL PROTECTED] Read my blog at blog.nitpicking.com. Reviews! Observations! Stupid mistakes you can correct! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
On Fri, 2008-07-04 at 17:24 +0200, Shawn Beasley wrote: michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) Reboot from cd an press escape to get to the grub command line. grub root (hd0,1) = your hard drive grub kernel /root/vmlinuz root=/dev/sda1 grub boot Should work, I had the same problem with an older server. The cd booted everything except the server :( I think it is possible to do what I want without using a Live CD, eg consider I was trying, remotely, to install Debian! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
michael wrote: On Fri, 2008-07-04 at 17:24 +0200, Shawn Beasley wrote: michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) Reboot from cd an press escape to get to the grub command line. grub root (hd0,1) = your hard drive grub kernel /root/vmlinuz root=/dev/sda1 grub boot Should work, I had the same problem with an older server. The cd booted everything except the server :( I think it is possible to do what I want without using a Live CD, eg consider I was trying, remotely, to install Debian! Like I said, I was only reporting my success. I could not use the netiso to install from the network (www), so I researched. and found out (without bootstrapping) you can copy these files, which are used by the netiso installer, to the root partition by using a live cd to access the system. This would of course not apply if you have a running system. You could then just copy them to the partition when booted into your running system. Then when you reboot, you can use the grub paramaters mentioned (keeping in mind the netiso cd will still be needed) to boot into the normal net install process. I hope you find what you are looking for. CU -- DigIT!al Ninja signature.asc Description: OpenPGP digital signature
Re: How to create qemu-bootable image using debootstrap?
On Mon, Jul 07, 2008 at 01:18:22AM -0700, David Barrett wrote: Andrei Popescu wrote: On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? If I recall correctly, qemu can boot a linux kernel directly so you *probably* don't need grub. Aha! I completely forgot about those options. This works great: sudo qemu -kernel-kqemu -kernel newtest.mount/boot/vmlinuz-2.6.18-6-486 -append root=/dev/hda1 ro -initrd newtest.mount/boot/initrd.img-2.6.18-6-486 newtest.raw It makes the command line a bit awkward, but does the trick. This is great workaround, thanks! That said, if possible, I'd still like to get grub installed to make it self-contained and boot up like normal (else I need to update all the startup scripts to be aware of the exact kernel version). can you not use the grub floppy disk image and just cat it into the boot sector? Another idea: write a script to install grub from a chroot, copy that script into the image, and then chroot in and run that script from your other script. or: make a barebones image with grub installed by some other non-automated method and then use that bare image as the starting point for your script, eliminating the dd step. just .02 A signature.asc Description: Digital signature
Re: How to create qemu-bootable image using debootstrap?
Hi, Andrew Sackville-West wrote: On Mon, Jul 07, 2008 at 01:18:22AM -0700, David Barrett wrote: Andrei Popescu wrote: On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: Carl Fink wrote: On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? No, I'm just going to use it as a QEMU image. It'll stay virtual, but it'll need to boot all the same. Unless there's some way to get it to boot without grub? If I recall correctly, qemu can boot a linux kernel directly so you *probably* don't need grub. Aha! I completely forgot about those options. This works great: sudo qemu -kernel-kqemu -kernel newtest.mount/boot/vmlinuz-2.6.18-6-486 -append root=/dev/hda1 ro -initrd newtest.mount/boot/initrd.img-2.6.18-6-486 newtest.raw It makes the command line a bit awkward, but does the trick. This is great workaround, thanks! That said, if possible, I'd still like to get grub installed to make it self-contained and boot up like normal (else I need to update all the startup scripts to be aware of the exact kernel version). can you not use the grub floppy disk image and just cat it into the boot sector? Another idea: write a script to install grub from a chroot, copy that script into the image, and then chroot in and run that script from your other script. or: make a barebones image with grub installed by some other non-automated method and then use that bare image as the starting point for your script, eliminating the dd step. just .02 A Previously, I had the same problem but I did not know how to deal with the partions (btw. I still have too figure out how did you got those numbers to be able to create smaller disks). The `parted' stuff you posted before was a missing piece of information. Here is a complete sequence of commands that - creates a harddisk image - install multiboot specification compliant kernel to it - install grub to the harddisk image -- sudo dd if=/dev/zero of=disk.img bs=1024 count=1048576 sudo parted disk.img mklabel msdos sudo parted disk.img mkpart primary ext2 0 954 sudo parted disk.img mkpart extended 954 1069 sudo parted disk.img mkpart logical linux-swap 954 1069 sudo parted disk.img set 1 boot on sudo parted disk.img mkfs 1 ext2 sudo mount -o loop,offset=16384 -t ext2 disk.img mnt sudo mkdir mnt/grub sudo cp /boot/grub/stage1 mnt/grub sudo cp /boot/grub/stage2 mnt/grub sudo cp /boot/grub/e2fs_stage1_5 mnt/grub # The contents of the `menu.lst' file should be: # # timeout 0 # default 0 # title minimal-kernel # kernel (hd0,0)/minimal-kernel # sudo cp menu.lst mnt/grub # The contents of the `grub.input' file should be: # # device (hd0) disk.img # root (hd0,0) # setup (hd0) # quit # sudo grub --device-map=/dev/null grub.input # We finally copy a multiboot specification compliant kernel # to our disk image. You can get the one I have tried here: # # http://altair.sk/uploads/minimal-kernel # # Its homepage :) # # http://altair.sk/mediawiki/index.php/Minimal_Kernel # sudo cp minimal-kernel mnt sudo umount mnt # And you can boot it ... qemu -m 100 -hda disk.img -boot c -no-kqemu -- Somehow this way. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
On Fri, 2008-07-04 at 17:56 -0300, Gabriel Parrondo wrote: El vie, 04-07-2008 a las 17:24 +0200, Shawn Beasley escribió: michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) OP is not using/installing ubuntu, he's installing debian and using fedora. I don't see where ubuntu fits. /vmlinuz and /initrd are links to files in /boot, which are installed by the kernel package (actually, the initrd is created, not installed). OP: You should chroot in /debian_chroot and run 'aptitude install linux-image-architecture'. If debootstrap didn't already, also install grub (or lilo if you prefer it). Edit fstab (don't forget about /proc) and exit the chroot. Then, if you have grub in the fedora system, run 'grub-install --root-directory=/debian_chroot /dev/device' and edit /debian_chroot/boot/grub/device.map if necessary. Re-enter the chroot and run update-grub. Then make the bios boot from that device, however you do it, and there you go. thanks, that sounds str forward - presumably the 'grub-install' will write a new MBR so when I reboot the machine it looks in /debian_chroot (ie I won't see the options from my [Fedora] /boot/grub/menu.lst)? (I'm wanting to be able to boot into Debian kernel, but if it screws up be able to go back into Fedora, and then, finally when got a working Debian, wipe the Fedora and have a Debian (only) system) many thanks, M -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
El lun, 07-07-2008 a las 22:54 +0100, michael escribió: On Fri, 2008-07-04 at 17:56 -0300, Gabriel Parrondo wrote: El vie, 04-07-2008 a las 17:24 +0200, Shawn Beasley escribió: michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) OP is not using/installing ubuntu, he's installing debian and using fedora. I don't see where ubuntu fits. /vmlinuz and /initrd are links to files in /boot, which are installed by the kernel package (actually, the initrd is created, not installed). OP: You should chroot in /debian_chroot and run 'aptitude install linux-image-architecture'. If debootstrap didn't already, also install grub (or lilo if you prefer it). Edit fstab (don't forget about /proc) and exit the chroot. Then, if you have grub in the fedora system, run 'grub-install --root-directory=/debian_chroot /dev/device' and edit /debian_chroot/boot/grub/device.map if necessary. Re-enter the chroot and run update-grub. Then make the bios boot from that device, however you do it, and there you go. thanks, that sounds str forward - presumably the 'grub-install' will write a new MBR so when I reboot the machine it looks in /debian_chroot (ie I won't see the options from my [Fedora] /boot/grub/menu.lst)? That's what the --root-directory parameter does. (I'm wanting to be able to boot into Debian kernel, but if it screws up be able to go back into Fedora, and then, finally when got a working Debian, wipe the Fedora and have a Debian (only) system) Check the default and savedefault options in grub's menu.lst. Basically, you use them to tell grub boot the default menu item, but before you do, set this menu entry as default for next reboot(s) -- Gabriel Parrondo GNU/Linux User #404138 GnuPG Public Key ID: BED7BF43 JID: [EMAIL PROTECTED] The only difference between theory and practice is that, in theory, there's no difference between theory and practice. signature.asc Description: Esta parte del mensaje está firmada digitalmente
Re: How to create qemu-bootable image using debootstrap?
Matej Kosik wrote: Previously, I had the same problem but I did not know how to deal with the partions (btw. I still have too figure out how did you got those numbers to be able to create smaller disks). The `parted' stuff you posted before was a missing piece of information. Here is a complete sequence of commands that - creates a harddisk image - install multiboot specification compliant kernel to it - install grub to the harddisk image Aha, excellent -- with your grub commands I was able to complete my script. (Though I'm still not sure where the stage1/2/e2fs_stage1 should come from -- currently it just copies off the host, which isn't that clean but works for now.) I've posted it on my blog and will keep updating it here: http://blog.quinthar.com/2008/07/building-1gb-bootable-qemu-image-using.html As for the magic numbers in the script to make it work for 1GB, here's how I came up with them for the dd command: bs = blocksize = 1024 count = 1GB/bs = (1024*1024*1024)/1024 = 1048576 For the parted command, I got the numbers by installing with the netinst ISO onto a 1GB raw file, and then doing parted test.raw print. I don't know how the netinst installer came up with those numbers, but I just copied them. Regardless, it seems like you can pretty much choose whatever you want; I'm sure there's a whole science behind it. (Where the 1069 came from I have no idea, as there are only 1024 MB on disk.) For the loop,offset=16384 that took some guesswork: parted print spit out 16.4K as the start of the first partition, and I guessed that it was just rounding off 16384 and it worked. Regardless, here it is for those of you following along. Thanks for all your help! -david --- echo Creating 1GB file of zeros in $1.raw dd if=/dev/zero of=$1.raw bs=1024 count=1048576 echo Formating $1.raw with ext2 filesystem /sbin/parted $1.raw mklabel msdos /sbin/parted $1.raw mkpart primary ext2 0 954 /sbin/parted $1.raw mkpart extended 954 1069 /sbin/parted $1.raw mkpart logical linux-swap 954 1069 /sbin/parted $1.raw set 1 boot on /sbin/parted $1.raw mkfs 1 ext2 echo Mounting $1.raw on $1.mount mkdir -p $1.mount sudo mount -o loop,offset=16384 -t ext2 $1.raw $1.mount echo Installing Etch into $1.mount sudo debootstrap --arch i386 etch $1.mount http://ftp.us.debian.org/debian echo Setting up host networking in $1.mount for apt sudo cp /etc/resolv.conf $1.mount/etc sudo cp /etc/hosts $1.mount/etc echo Installing kernel into $1.mount sudo chroot $1.mount apt-get update sudo chroot $1.mount apt-get -y install gnupg sudo chroot $1.mount apt-get update echo do_symlinks = yes relative_links = yes do_bootloader = yes do_bootfloppy = no do_initrd = yes link_in_boot = no /tmp/kernel-img.conf sudo mv /tmp/kernel-img.conf $1.mount/etc sudo chroot $1.mount apt-get -y install linux-image-2.6-686 echo Manually installing grub into $1.mount sudo mkdir -p $1.mount/boot/grub sudo cp /boot/grub/stage1 $1.mount/boot/grub sudo cp /boot/grub/stage2 $1.mount/boot/grub sudo cp /boot/grub/e2fs_stage1_5 $1.mount/boot/grub echo default 0 timeout 0 title Linux root (hd0,0) kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hda1 ro initrd /boot/initrd.img-2.6.18-6-686 /tmp/menu.lst sudo mv /tmp/menu.lst $1.mount/boot/grub sudo echo device (hd0) $1.raw root (hd0,0) setup (hd0) quit /tmp/grub.input sudo grub --device-map=/dev/null /tmp/grub.input echo Configuring qemu networking echo auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp /tmp/interfaces sudo mv /tmp/interfaces $1.mount/etc/network echo Starting sshd and granting $USER a root key sudo chroot $1.mount apt-get -y install ssh sudo chroot $1.mount /etc/init.d/ssh stop sudo mkdir -p $1.mount/root/.ssh sudo cp ~/.ssh/id_rsa.pub $1.mount/root/.ssh/authorized_keys sudo chmod -R 755 $1.mount/root/.ssh echo Dismounting $1.mount sudo umount $1.mount echo Done. To start, run: echo echo sudo qemu -kernel-kqemu -redir tcp:::22 $1.raw echo echo To SSH in, run: echo echo ssh -p [EMAIL PROTECTED] echo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
How to create qemu-bootable image using debootstrap?
What's the best way to create a raw disk image using debootstrap that can be booted with qemu? I think I've almost figured it out, but I'm not savvy with the low-level file commands. Can you point me in the right direction? I'm hacking together a few sources -- most notably http://www.debian.org/releases/stable/i386/apds03.html.en -- but I'm missing a couple steps. This is what I think I've got so far: #-- 1. Create the raw image # Create 1GB raw image dd if=/dev/zero of=image.raw bs=1024 count=1048576 # Format it with ext3 file system ??? how to do this ??? ??? can I do it all with a single partition ??? # Mount it mkdir -p image.mount sudo mount -o loop,offset=32256 image.raw image.mount #-- 2. Configure a chroot -- # Debootstrap it /usr/sbin/debootstrap --arch i386 etch image.mount \ http://ftp.us.debian.org/debian # Create /etc/fstab as follows: ??? what goes in here ??? # Mount the file system inside the chroot sudo chroot image.mount mount -a # -- 3. Enable networking # Though it'll ultimately be a qemu image, we need # to temporarily use the host's network interface # in order to get apt working. sudo cp /etc/resolv.conf image.mount/etc sudo cp /etc/hosts image.mount/etc #--- 4. Make it bootable - # First install the kernel sudo chroot image.mount apt-get update sudo chroot image.mount apt-get install \ linux-image-2.6.24-17-generic # Then install grub sudo chroot image.mount apt-get install grub sudo chroot image.mount apt-get grub-install /dev/ sudo chroot image.mount apt-get update-grub # --- 5. Done, boot it up! sudo qemu -kernel-kqemu image.raw Granted, at this point its networking will be screwed up, but that's a task for another day. I'm just trying to get it to boot. With this in mind, can you fill in any of the blanks in the above script? Thanks! -david -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Basically, grub-install appears to require an actual device, unlike parted (which was unexpectedly happy being given a simple raw file). My work-in-progress script for creating a bootable qemu image from scratch is here; can you help me finish it? echo Creating 1GB file of zeros in $1.raw dd if=/dev/zero of=$1.raw bs=1024 count=1048576 echo Formating $1.raw with ext2 filesystem /sbin/parted $1.raw mklabel msdos /sbin/parted $1.raw mkpart primary ext2 0 954 /sbin/parted $1.raw mkpart extended 954 1069 /sbin/parted $1.raw mkpart logical linux-swap 954 1069 /sbin/parted $1.raw set 1 boot on /sbin/parted $1.raw mkfs 1 ext2 echo Mounting $1.raw on $1.mount mkdir -p $1.mount sudo mount -o loop,offset=16384 -t ext2 $1.raw $1.mount echo Installing Etch into $1.mount sudo debootstrap --arch i386 etch $1.mount http://ftp.us.debian.org/debian echo Setting up host networking in $1.mount for apt sudo cp /etc/resolv.conf $1.mount/etc sudo cp /etc/hosts $1.mount/etc echo Installing kernel and grub into $1.mount sudo chroot $1.mount apt-get update sudo chroot $1.mount apt-get -y install linux-image-2.6-486 grub sudo grub-install --root-directory=$1.mount/root $1.raw Basically, this last command doesn't work; it fails as follows: [EMAIL PROTECTED]:~/test$ sudo grub-install --root-directory=blah.mount/root blah.raw Probing devices to guess BIOS drives. This may take a long time. Format of install_device not recognized. Any ideas? Thanks! -david -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: How to create qemu-bootable image using debootstrap?
On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: David Barrett wrote: What's the best way to create a raw disk image using debootstrap that can be booted with qemu? Following up on my previous post: I've figured out some of the steps, but I'm stuck on installing Grub. Do you know how to install grub on a raw device file? Forgive a silly question, but why do you want to install grub on the image? Are you planning to dd it onto a physical disk? -- Carl Fink [EMAIL PROTECTED] Read my blog at blog.nitpicking.com. Reviews! Observations! Stupid mistakes you can correct! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
using debootstrap to install Debian
I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: using debootstrap to install Debian
michael wrote: I was following the instructions on, eg Debian_Admin, to attempt an installation of Debian on a Fedora box (that didn't like the netinst CD). I have got as far as installing a chroot in /debian_chroot but cannot work out the final steps needed to be able to boot into the Debian installation. Could some kind soul help me out? Thanks, M Boot from UbuntuLive or the like (must have a grub boot loader), mount your hard drive and copy the initrd.gz vmlinuz to /root. (found in install.i386) Reboot from cd an press escape to get to the grub command line. grub root (hd0,1) = your hard drive grub kernel /root/vmlinuz root=/dev/sda1 grub boot Should work, I had the same problem with an older server. The cd booted everything except the server :( Hope I could help -- DigITal Ninja signature.asc Description: OpenPGP digital signature