LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bootable (portable) SD card - system updates add fixed disks to grub (https://www.linuxquestions.org/questions/linux-general-1/bootable-portable-sd-card-system-updates-add-fixed-disks-to-grub-4175465576/)

Rexx Magnus 06-11-2013 11:14 AM

Bootable (portable) SD card - system updates add fixed disks to grub
 
I've created an encrypted bootable SD card that I can take anywhere. I have a problem when running the updates on it - often grub will redetect any fixed disks in the computer and add those to the boot menu. Sometimes it actually updates grub ON those fixed disks.

I had to originally install the SD card by booting with the drives disconnected (SD card in USB reader) - it worked fine once you rebooted with the disks reconnected. Ideally, I want to be able to use this on any computer without affecting the built in drives.

On my laptop and desktop machines, I cannot disable the drives from the bios and disconnecting the drives when I'm on my laptop is not practical.

Is there a way of making the updates to grub etc. only apply on the specific drive that I've booted off. fstab is set up to use the UUID of the partition when mounting, so that it specifically refers to the encrypted USB drive.

I was using Debian Wheezy for this, and either want to use Debian, Mint or another Debian based distro for the install, so any instructions that might be specific to Debian would be helpful.

yancek 06-12-2013 09:13 PM

What are you updating?

Quote:

often grub will redetect any fixed disks in the computer and add those to the boot menu.
If you are running update-grub, that would be expected behavior.

Quote:

Sometimes it actually updates grub ON those fixed disks.
I'm not sure if I'm reading that the way you meant but I take that to mean when you update-grub on the SD card, it updates and changes the bootloader on an internal hard drive, is that what you meant? That's completely illogical. I have Ubuntu on sda5 and I can run update-grub on it and it will add any new systems to the grub.cfg file in Ubuntu but has no effect on the primary system on another partition which has Grub in the mbr which is also expected behavior.

Rexx Magnus 06-13-2013 01:47 AM

Quote:

Originally Posted by yancek (Post 4970718)
What are you updating?



If you are running update-grub, that would be expected behavior.



I'm not sure if I'm reading that the way you meant but I take that to mean when you update-grub on the SD card, it updates and changes the bootloader on an internal hard drive, is that what you meant? That's completely illogical. I have Ubuntu on sda5 and I can run update-grub on it and it will add any new systems to the grub.cfg file in Ubuntu but has no effect on the primary system on another partition which has Grub in the mbr which is also expected behavior.

It happened when I did a dist-upgrade, and I think that several packages that updated the initrd were updated, along with grub. Maybe the the latter happened (your interpretation is correct) and it added the fixed disks to the SD card's configuration files. I don't want that to happen.

It may be that I can experiment with it a bit more to see exactly what happens to the system, but I definitely don't want it adding fixed disks to the bootable sd card's boot menu. I think the last time it did, it wouldn't boot when the card was put in another machine.

yancek 06-13-2013 08:30 AM

Quote:

It happened when I did a dist-upgrade
In that instance I would expect update-grub to be run and any other operating systems on any disks it can see would be added to the grub.cfg file. You could easily then delete any unwanted entries from grub.cfg. Don't see how that would prevent it from booting later.

Rexx Magnus 06-13-2013 12:13 PM

Quote:

Originally Posted by yancek (Post 4970971)
In that instance I would expect update-grub to be run and any other operating systems on any disks it can see would be added to the grub.cfg file. You could easily then delete any unwanted entries from grub.cfg. Don't see how that would prevent it from booting later.

I'll have to give it another go and see what happens, then.

I'll also have to try installing with the drive plugged in, and the fixed disks connected.


All times are GMT -5. The time now is 02:56 AM.