[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to install Debian 7 to external hard disk



On 8/26/13, Bonno Bloksma <b.bloksma@tio.nl> wrote:
>On Aug 26, 2013 5:35 AM, "C.T.F. Jansen" <frank.jansen@actrix.gen.nz> wrote:
>> Is there a preferred way to install Debian 7
>> from DVD to an external (USB) hard disk ?
>> The whole external hard disk is to be used instead of the internal hard
>> disk.
>> One then boots from either the external hard disk or the internal hard
>> disk.

You can do this in 2 ways:
1) Having grub on internal hdd with menu entry for external hdd
/boot/kernel... alternatives

2) Having hardware startup provide for "native" boot straight off of
external hdd.
For this option to work, grub must obviously be installed on the external hdd,
and that hdd install /etc/fstab needs to be updated to use UUIDs
rather than /dev/sdX names;
I believe UUID mapping is automatic at *some* point, not sure when in
install or later bootup sorry.

>> To set this up, at what stage in the install process does one actually put
>> the new release on to the external disk ?
> When it asks which disk to set it up to and whether you want to do the
> partitioning yourself (manual) or guided.
>
>> Does one need to also tell the install program where to put grub ?
>> or does it do that automatically ?
> You just stated above you have a production version of Debian on the
> internal disk, so it has Grub already. The new installation on the external
> disk just needs to be added to the existing Grub config. The installer
> should do that for you.

That's option 1) above.

I recommend to use option 2), possibly in conjunction with option 1).

>> Is there any other special configuration one needs to do to properly
>> put the new release on to the external hard disk ?
> Not that I know of.

Make sure about the grub installation going to the external hdd.

During "advanced install" which is what I use, I pressed Enter too
quickly on this exact screen, and grub got half installed to internal,
as well as external drive.

If that happens, you use rescue CD then chroot into the drive you need
to fix, then run update-grub from inside the chroot session. Something
like that to fix grub :)

You can do similar for external hdd if you mess up the grub install,
but the rest is installed properly - rescue boot off CD, chroot,
grub-install.

In either grub-fixup case, check grub parameters/config, to make sure
that grub-install will do what you want.
For it to work, _before_ you do chroot, you may have to do things like:
 mount /dev/sdDriveToFix /mnt
 mount --bind /proc /mnt/proc
 mount --bind /dev to /mnt/dev
etc, then finally something like:
 chroot /mnt /bin/bash

Good luck :)

>> It is vastly preferable not to unplug the internal hard disk or otherwise
>> disrupt the functioning system.

In fact, it is possible (though I failed when I tried a couple years
back), to save the CD image to your internal HDD, then add a grub
entry to loopback mount+boot into that image (chroot style or
something?).

That ought be significantly faster than booting off of CD, but may not
work if you end up needing to do a rescue-install-to-fix-grub
:)

> No, the installer needs to access the Grub config on that disk. Unplugging
> it would also change the name of the disks (sda, sdb, etc) and might
> interfere with the installation or later on with running it, although it
> should not when using the default disk labels.

At some point, in modern debian systems, AIUI, there is an automatic
conversion to UUIDs.
 man fstab
 man grub
 echo "\o/"

>> Of course the internal hard disk will be backed up before the attempted
>> install ...
> Yes, please do so. ;-)

If production, of course. If home laptop, well, if you can be bothered
- it's only a reinstall :)
Actually no, always do a backup, especially of important files.

Good luck
Zenaan


Reply to: