You are not logged in.
Pages: 1
Hi! I apologize if you've my previous post on this. I made a post almost two months ago with this question but I had pneumonia and completely forgot about the post. Because it's been so long, I am making a new post because I'm not sure if anyone (including the people that previously helped me) will see it. Basically, I have arch on an internal hard drive at /dev/sda3. I also have a flash drive on which I would like to have a copy of /dev/sda3. However, one challenge of this is that I only want arch on a small partition of this. I would like to keep the majority of the flash drive for general storage and keep it formatted with exfat. To visualize this, here is my lsblk output:
lsblk
NAME LABEL FSTYPE UUID MOUNTPOINT FSUSED FSSIZE FSUSE%
sda
├─sda1 vfat 2600-471E
├─sda2
├─sda3 ext4 38ecd6d2-4502-4fd1-b548-ba903101f322 / 20.6G 62.8G 33%
└─sda5 ext4 712504da-d862-4184-92f9-261a86c9c425
sdb
├─sdb1 EFI vfat 67E3-17ED
├─sdb2 FlashDrive exfat 618C-4570
└─sdb3 Arch ext4 4ecb08f5-dd79-40d3-9339-d93b8ba59561I have followed the advice of @V1del (by the way, thanks for the response) and formatted /dev/sdb3 with ext4 and copied the parts of /dev/sda3 that I want on it with:
rsync -gloptrucaAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/usbmntNext I edited my fstab on the flash drive to get the right UUID on it. Lastly, after running fdisk -l, I saw that it had an efi partition at /dev/sdb1
Disk /dev/sdb
Disk model: SanDisk 3.2Gen1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Device Start End Sectors Size Type
/dev/sdb1 40 409639 409600 200M EFI SystemBut after mounting it I saw that it was empty. The wiki (https://wiki.archlinux.org/title/Instal … edium#GRUB) instructed me to run the following command but results in an error.
$ grub-install --target=x86_64-efi --efi-directory=/mnt/usbmnt --removable --recheck
Installing for x86_64-efi platform.
grub-install: error: failed to get canonical path of `/boot/grub'.When I try to boot from this drive it doesn't work and I was hoping someone could help me. Thanks in advance!
ps I have read the wiki guide I linked above.
Last edited by anthanor2 (2021-12-26 00:21:21)
Offline
Sorry if you're seeing this I accidentally submitted my question before I was done but am finishing it now.
Edit, I have finished my post sorry again for that!
Last edited by anthanor2 (2021-12-26 00:21:53)
Offline
Mount your sticks root partition on /mnt and the ESP on /mnt/boot chroot in and run the installation command/the grub-mkconfig invocation from the "perspective" of your stick.
Offline
Thanks for helping again V1del! Just to clarify, I should do this from inside my main arch partition, correct? I also just wanted to confirm that I should first mount /dev/sdb3 and THEN mount sdb1 within my sdb3 mnt. Thanks!
Last edited by anthanor2 (2021-12-26 01:35:33)
Offline
I tried following what you told me and mounted /dev/sdb3 at /mnt and then /dev/sdb1 at /mnt/boot. One thing I want to make sure is that before mounting /dev/sdb1, I noticed that /mnt/boot had the following files: grub, initramfs-linux-fallback.img, initramfs-linux.img, vmlinuz-linux. Don't I need these to boot arch? When mounting sdb1, these files are deleted. Back to my issue I ran the same command with the new ESP mount and got this:
[root@archlinux /]# grub-install --target=x86_64-efi --efi-directory=/boot --removable --recheck
Installing for x86_64-efi platform.
grub-install: error: cannot find a device for /boot (is /dev mounted?).What am I doing wrong? I ran lsblk to see where my flash drive was mounted from the perspective of chroot and got
[root@archlinux /]# lsblk
lsblk: failed to access sysfs directory: /sys/dev/block: No such file or directoryI fixed this by running mount -t sysfs sysfs /sys but I am unsure how to proceed. Thanks!
Offline
They aren't deleted, you hide them by mounting your ESP over the directory.
If you have those already then mount the ESP somewhere else e.g. /mnt/efi, then you need to arch-chroot from arch-install-scripts into your /mnt (this is a helper script that does all the necessary chroot mounts, if you want to know how to do this manually see https://wiki.archlinux.org/title/Chroot ) and do a
grub-install --target=x86_64-efi --efi-directory=/efi --removable --recheckOffline
Pages: 1