1

The ssd hard drive in my My Microsoft Surface Pro 3 is broken. It overheats in one minute and after that no read or write is possible. To replace the ssd drive, you have to remove the screen (which is extremely hard). Thus, I want to create bootable sd-card and use the sd-card as main disk.

How to create and enable EFI bootable sd-card?

0

1 Answer 1

1

So, I have managed so far:

Prequisities:

  • usb flash drive with bootable Ubuntu live cd (I used Rufus to create Ubuntu LTS 20.04)
  • Empty SD-card (I have 64Gb, bigger the better)
  • Wi-Fi with internet access

Procedure:

  1. Shut down. Go to bios by pressing volume up and power. Keep them pressed until you see the "surface" text.

  2. Disable all security features from the bios front page (bullets 1 and 2), change the boot order to "ssd->hard drive", insert usb flash drive with ubuntu livecd to usb2 port, sd-card to sd-slot and reboot.

  3. When booting, the boot screen should be red. After Ubuntu live CD has loaded, choose "try ubuntu" (do not install as it will crash as you cannot disable the ESP/efi flag from broken hard drive).

  4. Open terminal (hit windows key from keyboard and write "terminal")

  5. Run "ubiquity --no-bootloader" and install ubuntu...

  6. ...when it offers you options: 1. erase programs, 2. wipe disk or 3. something else. Choose something else (it allows to repartition the sd-card).

  7. Repartition the sd-card to three partitions (here two might also work). For me sd-card is shown as /dev/sdc.

7.1. Make 500 Mb /dev/sdc1 and use it as EFI.

7.2. Make 500 Mb /dev/sdc2 and use it as "reserved for bootmanager".

7.3. Make as big ext4 volume that fits to the sd-card and mount it to / (this is /dev/sdc3)

  1. Finish the Ubuntu installation. It might give error at the end. Do not reboot, continue.

  2. Install Refind. In terminal:

sudo apt-add-repository ppa:rodsmith/refind
sudo apt-get update
sudo apt-get install refind
  1. run in terminal (sdc1 is the efi partititon):

refind-install --use-defaults /dev/sdc1

  1. Mount the /dev/sdc1 and /dev/sdc3 and copy linux kernels to efi folder (in terminal):
sudo mkdir /mnt/sdc1
sudo mkdir /mnt/sdc3
sudo mount /dev/sdc1 /mnt/sdc1
sudo mount /dev/sdc3 /mnt/sdc3
sudo mkdir /mnt/sdc1/EFI/BOOT/ubuntu
sudo cp -r /mnt/sdc3/boot/* /mnt/sdc1/EFI/BOOT/ubuntu/
  1. Edit the refind.conf to match the location of linux kernel as follows:

12.1. Find the UUID-number of your /dev/sdc3 which you mounted to / (my UUID-number is 9e9a435a-2dce-49ad-a97b-197c93b7c231):

sudo lsblk -f

12.2 Copy the long names in EFI to shorter ones (here the version numbers might differ, adjust as needed):

cd /mnt/sdc1/EFI/BOOT/ubuntu/ sudo cp vmlinuz-5.13.0-30-generic vmlinuz sudo cp initrd.img-5.13.0-30-generic initrd.img

12.3 Add the following to the end of /mnt/sdc1/EFI/BOOT/refind.conf (note that the long UUID number is the one that I got from step 12.1, adjust accordingly and the path is the one created in step 11 without the /mnt/sdc1):

menuentry Ubuntu {
    icon /EFI/BOOT/icons/os_linux.png
    volume 9e9a435a-2dce-49ad-a97b-197c93b7c231
    loader /EFI/BOOT/ubuntu/vmlinuz
    initrd /EFI/BOOT/ubuntu/initrd.img
    options "ro root=UUID=9e9a435a-2dce-49ad-a97b-197c93b7c231"
    enable 
}
  1. Remove usb-stick, keep sd-card in and reboot. Choose linux icon and enjoy!

  2. In bios (volume up + power booting), enable the bullet 1. Trusted module platform. Keep the bullet 2. Device signature disabled. The linux kernel is not signed... I guess I would need the signed .efi version of the linux kernel instead of initrmfs.

Important aspects:

  • Ubuntu bootloader install does not work as the broken disk has EFI flag enabled and you cannot change it as write operations to broken disk don't work.
  • The first partition in sd-card (/dev/sdc1) is FAT system with additional EFI flag
  • refind can run any image, not just .efi
  • IMPORTANT: stock refind does not understand ext4. Copy the linux kernels to FAT drive (sdc1)
  • refind only understands disks with their UUID. Tell in config that root and volume is the disk with <UUID#>.
  • You need internet to update the live CD. Refind is not included
  • FAT drive does not have symbolic links, hence copy the kernels to shorter names
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .