2

I have a Dell Vostro 1700 that a friend gave me because it died.

On investigation I found that it no longer recognized the internal hard drives, but booted fine from an Ubuntu CD or from Ubuntu on a USB flash drive. It currently runs from the USB, but painfully slowly. I have a caddie that replaces the optical drive with a hard drive, but it is not recognized as a bootable drive so I can install Ubuntu on the hard drive and the laptop runs great until I shut down. So what I would like to do is get it to boot from the USB flash drive, but then run from the hard drive in the CD caddie. Is this possible and how would you do it?

I am doing this as a project to learn and just because.

Matthieu
  • 506
pentacon
  • 21
  • 1

2 Answers2

2

I could solve the same issue with the following method.

I'll consider that for the rest of the article (change it as per your own configuration):

  • the hard drive is sda and the boot partition is sda1 (which maps to (hd1,gpt1) in GRUB, (hd0) being the GRUB USB)
  • /dev/sda1 contains a /boot/vmlinuz kernel and /boot/initrd.img disk
  • the Ubuntu bootable USB is sdb under Ubuntu Live
  • the to-be GRUB USB is sdc under Ubuntu Live

Boot on the Ubuntu Live USB:

  1. Insert the new USB and create on it an ext4 partition with grub_bios flag (that will be /dev/sdc1) and a second ext4 partition with "boot" flag (that will be /dev/sdc2 on which GRUB will boot)
  2. Mount the second partition so grub-install can create the /boot/grub files: mount /dev/sdc2 /mnt
  3. Install GRUB on it: grub-install --boot-directory=/mnt /dev/sdc
  4. Edit file /mnt/grub/grub.cfg with the following content:
set root=(hd1,gpt1)
linux /boot/vmlinuz root=/dev/sda1
initrd /boot/initrd.img
boot

Reboot on the GRUB USB and it should be booting your hard drive.

EDIT: As per @kenn's comment: it's better to use partitions UUIDs or labels instead of direct links to hard drive. The UUIDS (and labels) are available in your Ubuntu Live under /dev/disk/by-partuuid or /dev/disk/by-partlabel. Then use in your grub.cfg:

linux /boot/vmlinuz root=PARTUUID=<partition UUID>

or:

linux /boot/vmlinuz root=PARTLABEL=<partition label>
Matthieu
  • 506
1

In general it is possible to boot from USB and run from a hard disk. Install to the caddy disk, install again to another USB, and edit the USB's grub boot commands in /boot/grub/grub.cfg to point to the caddy disk. The trick will be to figure out what letter the caddy will get when there is only one USB present. See http://www.linlap.com/dell_vostro_1700 for some specific video and wireless issues. Your situation may have special problems:

  1. Why is the internal hard disk not seen? This could be an incipient motherboard failure. USB booting may still work (for awhile longer), but no hard disk, even in the caddy may be referenced.
  2. The caddy may cause grub problems. Any reference to a caddy on an old HP caused grub to hang for a minute. No reference within grub to the caddy worked, although the caddy worked fine as extra storage when running from another root.
ubfan1
  • 19,049