I took the opportunity to learn Linux admin, and migrate xps 13 from the current 256GB SSD to 1TB SSD.
Mostly based on https://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows/88432#88432
1. "dump /dev/sda /mount/"Seagate Backup Disk"/my_file"
2. boot into live Ubuntu 18.04
3. "restore /mount/"Seagate Backup Disk"/my_file /my_mount
4. Mount other things: /my_mount/boot/efi, /dev, /usr, /dev
" for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/my_mount$i"; done "
5. sudo chroot /my_mount
6. reinstall grub:
> grub-install /dev/nvme0n1p # be careful not to use nvme0n1p3. 3 would not work
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-88-generic
Found initrd image: /boot/initrd.img-4.15.0-88-generic
Found linux image: /boot/vmlinuz-4.15.0-74-generic
Found initrd image: /boot/initrd.img-4.15.0-74-generic
Found linux image: /boot/vmlinuz-4.15.0-rc6-spectretee
Found initrd image: /boot/initrd.img-4.15.0-rc6-spectretee
Found linux image: /boot/vmlinuz-4.15.0-rc4-custom
Found initrd image: /boot/initrd.img-4.15.0-rc4-custom
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
7. Update fstab with new UUIDs
blkid | grep -i efi
grep -i efi /etc/fstab
If current EFI partition UUID (from blkid
) differs from the one in /etc/fstab
, update /etc/fstab
with current UUID.ubuntu@ubuntu:/boot/grub$ blkid | grep -i efi
/dev/nvme0n1p1: LABEL="ESP" UUID="7694-A0BD" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="0bf7a902-bb97-42a5-bd40-b1f1d8e5277f"
root@ubuntu:/etc# cat fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/nvme0n1p3 during installation
UUID=5cd800ce-94b9-479e-bdf0-4f43e35beb8c / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=E628-281B /boot/efi vfat umask=0077 0 1
# swap was on /dev/nvme0n1p4 during installation
UUID=db7178b3-6c68-465f-8a77-85f19f256882 none swap sw 0 0
/dev/disk/by-id/usb-WD_My_Passport_0748_575843314137324630383933-0:0-part1 /mnt/usb-WD_My_Passport_0748_575843314137324630383933-0:0-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
New /etc/fstab after fixing up:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/nvme0n1p3 during installation
UUID=5cd800ce-94b9-479e-bdf0-4f43e35beb8c / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=7694-A0BD /boot/efi vfat umask=0077 0 1
# swap was on /dev/nvme0n1p4 during installation
UUID=db7178b3-6c68-465f-8a77-85f19f256882 none swap sw 0 0
/dev/disk/by-id/usb-WD_My_Passport_0748_575843314137324630383933-0:0-part1 /mnt/usb-WD_My_Passport_0748_575843314137324630383933-0:0-part1 auto nosuid,nodev,nofail,noauto,x-gvfs-show 0 0
Finally, exit and reboot.
No comments:
Post a Comment