Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi! I am struggling since 3 days with this problem and I am exhausted of that s**t.
I want to install it on a pendrive where I have debian live, a couple of rescue disk, an ext2 partiton for the persistent of the Debian, and another partition as a storage. The first partition is the one with the Debian, and it boots properly. The system from where I am executing all the commands is an Ubuntu.
Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for /dev/sda1. Check your device.map
So I did a "sudo grub-mkdevicemap", but probably this does nothing because It will create the device.map on my hard disk and not in the USB.
This is the fdisk -l result:
Quote:
Disk /dev/sda: 28,9 GiB, 30992891904 bytes, 60532992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x13b62606
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 0 4186111 4186112 2G 0 Empty
/dev/sda2 1416 2247 832 416K ef EFI (FAT-12/16/32)
/dev/sda3 4186112 10477567 6291456 3G 83 Linux
/dev/sda4 10477568 60532991 50055424 23,9G 5 Extended
/dev/sda5 10479616 12220415 1740800 850M 83 Linux
/dev/sda6 12222464 13963263 1740800 850M 83 Linux
/dev/sda7 13965312 60532991 46567680 22,2G 83 Linux
For some reason, the partition containing the Debian-live image copied with dd appears as empty, but it runs perfectly.
Also I tried the guide on a Raspberry pi3, where I had another error, saying something about it can't find the canonical path to somewhere (sorry I don't remember now)
Ideas?
Thanks
Last edited by Yotaphoner; 01-02-2019 at 02:41 PM.
The link you posted explains how to install Grub to a blank drive with Ubuntu. I don't see anything on the page indicating otherwise. YOu already have a Live Debian which boots and I expect that you get the error about not finding Grub because it is booting with syslinux not Grub. When you loop mount the Debian iso on the flash drive from Ubuntu, do you see a boot/grub directory with the appropriate files?
In any case, if you have the Live Debian on sda1, you don't want to try to install Grub there as that is a read-only filesystem. Doing what I think you are trying to do should be possible but I would think the best first step would be to install Grub.
Maybe you are right about booting with syslinux because I can't find the grub folder on the boot folder. I just read something about it for the first time this afternoon.
I dont understand what you say about the no possibility to install grub on the partition with Debian because its read only. I mean... It becomes read only after "dd" an iso? Thats non sense. It is that the case?
And well, your last sentence says I should try to install grub, so I am confused because that is what I was trying to do and you said I cant do it where the partition is. So where I have to install it? And how?
/dev/sda2 1416 2247 832 416K ef EFI (FAT-12/16/32)
I'm not sure how it works with isohybrid live CDs, but the Debian live would be isohybrid. To have it boot in both BIOS and UEFI, a GPT partition table is also created in some isohybrid methods according to syslinux isohybrid, as per GPT standards there should also be a Protective MBR, whether or not a protective MBR is included in Debian live ISO is unknown to me thus far but I've recently struggled to install Debian testing in UEFI mode in VMWare. In attempts to do so, I tried directly off the ISO and burning the ISO to a USB and could not do it. I could do Ubuntu, Mint and Fedora UEFI virtual machines.
But here's where I'm going...
After burning the Debian netinstall ISO to the USB a few times using different settings in Rufus and directly with dd, the 32GB USB was stuck at 350MB in size and I couldn't get the full 32GB size back through traditional re-partitioning re-formatting. I eventually used dd to zero out part of it with: dd if=/dev/zero of=/dev/sdb before I was able to get the full 32GB back. So I'm guessing there is a protective MBR associated with Debian isohybrid disks images.
the partition containing the Debian-live image copied with dd appears as empty, but it runs perfectly.
your suppose to dd an iso to the whole usb not to a partition. the reason it debian probably works is you dd to the first partition, creating a readonly partition. thus causing errors when trying to install grub. I suggest to recreate a msdos partition table, reinstall ubuntu, then mount the Debian-live image, find the grub.cfg file in the mounted iso to see what to label the first partition and format to fat32. copy the contents of the debian-iso to the first partition. This should allow you to install grub to the mbr and also allow to boot the Debian-live on an uefi systems.
Last edited by colorpurple21859; 01-02-2019 at 09:44 PM.
I dont understand what you say about the no possibility to install grub on the partition with Debian because its read only. I mean... It becomes read only after "dd" an iso?
If you use dd to write an iso file to a flash drive, it will be read only. If you use unetbootin, rufus, pendrivelinus or any other similar software it will be read only. If you want to install Grub to the flash drive you will need to install it to a partition other than the one on which you have Debian. Since you don't seem to have an Grub files, that looks like a problem. You would also need to manually create the grub.cfg file if you want to boot some other 'rescue disk' on the usb. Might be simpler to do a full install of Debian or Ubuntu on the flash drive on a partition of 10GB. Not really clear what your end goal is.
Are you booting the Live Debian directly, setting the boot priority in the BIOS to boot the Debian usb OR are you booting it from an entry in the Ubuntu grub.cfg file?
the windows program rufus does something similar to what I described. If you select efi and bios for target, rufus will create a msdos partition table with a fat32 partition using the whole usb, install syslinux to mbr, then extract the contents of the iso onto the usb. This will allow you to boot on both efi and legacy systems and still read write to the usb. I more familiar with rufus then with unetbootin or pendrivelinus. Then you could use gparted to reduce the size of the debian-live partition, to create your other partitions for ubuntu and allow you to install grub to mbr.
Last edited by colorpurple21859; 01-02-2019 at 09:46 PM.
Ok I understand that thing of the read-only partition when you dd, thanks
Quote:
Originally Posted by colorpurple21859
I suggest to recreate a msdos partition table, reinstall ubuntu, then mount the Debian-live image, find the grub.cfg file in the mounted iso to see what to label the first partition and format to fat32. copy the contents of the debian-iso to the first partition. This should allow you to install grub to the mbr and also allow to boot the Debian-live on an uefi systems.
Why do I have to reinstall Ubuntu? Just to clear that, Ubuntu is installed on the SSD, not in the USB. There is no Ubuntu on the USB. And also why is this of recreating a msdos partition?
Quote:
Originally Posted by colorpurple21859
the windows program rufus does something similar to what I described. If you select efi and bios for target, rufus will create a msdos partition table with a fat32 partition using the whole usb, install syslinux to mbr, then extract the contents of the iso onto the usb.(...)
I read somewhere there isn't any automatic tool to configure syslinux and it has to be handmade. Is this true? Because I would love something that gives me less work. Also I don't understand if syslinux is a replacement of GRUB, so I don't need to install GRUB if I install syslinux. <---- Please answer this
Quote:
Originally Posted by yancek
If you want to install Grub to the flash drive you will need to install it to a partition other than the one on which you have Debian. Since you don't seem to have an Grub files, that looks like a problem. You would also need to manually create the grub.cfg file if you want to boot some other 'rescue disk' on the usb
I thought it had to be installed on the same partition where the linux is. Correct me if I am wrong please. And for the grub.cfg the plan was to do that "wget pendrivelinux.com/downloads/grub.cfg" and at that point less figure out which is the next step.
Quote:
Originally Posted by yancek
Might be simpler to do a full install of Debian or Ubuntu on the flash drive on a partition of 10GB. Not really clear what your end goal is
My goal is t create a pendrive which I can use as a live system and also as a rescue media, and I prefer the live Debian because my USB are 2.0 and using the live system it will be load at the RAM, and I think it will be faster
Quote:
Originally Posted by yancek
Are you booting the Live Debian directly, setting the boot priority in the BIOS to boot the Debian usb OR are you booting it from an entry in the Ubuntu grub.cfg file?
I am booting the Live Debian directly
Last edited by Yotaphoner; 01-03-2019 at 05:01 PM.
Why do I have to reinstall Ubuntu? Just to clear that, Ubuntu is installed on the SSD, not in the USB
I was under the impression that ubuntu was installed on the usb.
Quote:
I read somewhere there isn't any automatic tool to configure syslinux and it has to be handmade. Is this true? Because I would love something that gives me less work. Also I don't understand if syslinux is a replacement of GRUB, so I don't need to install GRUB if I install syslinux. <---- Please answer this
You can use grub or syslinux to boot debian-live as long as you get config files set up correctly. For booting a usb on a legacy system need some sort of bootloader installed to mbr of usb. efi systems require a fat32 partition therefore a msdos partition scheme with a fat32 partitiion works for both legacy and efi system
Quote:
And also why is this of recreating a msdos partition?
Wasn't sure if the usb had a gpt or msdos scheme or if the dd of debian-live affected the partition table.
Quote:
I thought it had to be installed on the same partition where the linux is
I assume your talking about grub, and the answer is no. Grub boot files can be installed as a stand alone to any partition or drive independent of the linux os that grub is being installed from. Any changes that need to be made to the grub.cfg will have to be done manually. any grub-modules that need to be pre-loaded at boot time to acess alternate file systems will need to be added when grub-install is ran.
Last edited by colorpurple21859; 01-03-2019 at 06:28 PM.
I read somewhere there isn't any automatic tool to configure syslinux and it has to be handmade. Is this true? Because I would love something that gives me less work. Also I don't understand if syslinux is a replacement of GRUB, so I don't need to install GRUB if I install syslinux. <---- Please answer this
The automatic tool for Grub2 would be the grub-mkconfig software which updates Grub. Ubuntu and some other Linux systems use the 'stub' update-grub which run the grub-mkconfig software. This won't work on your Debian Live as everything will be lost on reboot. I'm not that familiar with syslinux and don't know if anything similar exists for it.
As pointed out above, you do not need to install Grub to the same partition on which you have your Linux OS. You would need to install Grub to a different partition (200MB should be large enough) with a Linux filesystem. In your case, you will need to manually create the grub.cfg file menuentries. Installing Grub is explained in detail at the link below under section 2.2.3 and 2.2.5.
I once built me a kickbutt Debian live with full hardware support many years ago, but I didn't create an ISO, I created the image file. I made two partitions, the second only large enough for the image file and placed it in that partition. Then I formatted the rest of the USB NTFS. Windows (at the time anyways) only shows one partition on removable media, so the Debian was not visible when plugged in a Windows box.
Then I installed YUMI which would allow me to boot multiple ISOs, I had a Windows 7PE ISO, Windows XP PE ISO, PLOP ISO, SuperGrub2 ISO, BootitBM ISO, etc. Many ISOs in the appropriate Yumi folder on the large NTFS partition with tons of space left over in that partition for data files etc, basically I could still use the pendrive as a regular data drive, but it was bootable.
So when I booted it and was presented with the nice YUMI menu, I would select the PLOP ISO and boot it up, it would see all partitions on all drives, I would then select the Debian live image partition and boot it from PLOP.
you can use the grub.cfg that is in \boot/grub on the iso.
to boot in efi mode extract the efi directory from the efi.img that is in /boot/efi on the iso and copy it to the / of the usb
Last edited by colorpurple21859; 01-04-2019 at 05:27 PM.
Today I tried the SuperGrub2 iso, installing it with rufus in a partition of 50MB on the pendrive. Then I mounted the iso of Debian life on my linux machine and with "rsync" copied it to its own partition of the pendrive, and now it is writtable. Also "dd" another benchmarking distro to another partition. And it works, but not in the best way. SuperGrub2 can acces to both distros installed but it takes some time to navigate through the menus and detect everything. SuperGrub also allows to boot ISO's, as Brain described, but I don't want navigate in a Grub menu. I want the classical and clean Grub menu. Also the user interface is ugly as hell.
One thing it surprised me is, even with the partition being able to write on it, changes aren't saved. So I will have to discover how to save changes. I read something about creating a ext2 partition where changes are saved, but now I don't have the guide. One problem at time.
Tomorrow night (European night) I will struggle again to create the USB with the grub working properly on there. And also tell to you now I don't have UEFI, just the old BIOS, but creating an hybrid boot it will be the best
Thanks for all your help. I am learning a lot, but the goal is not yet reached so... I will tell you tomorrow how it goes..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.