Score:0

Having trouble moving symlinks from backup to boot partition

in flag

The context

I have a dual-boot Ubuntu (Jammy Jellfish)/Windows laptop (Dell XPS 9550). My /boot partition was too small to support an update, so I used GParted to attempt to resize it. However, I ran into a GParted bug around resizing FAT partitions, so instead used the workaround approach of deleting the partition, formatting it as Ext4, resizing it, and then reformatting it as FAT and restoring my /boot files from a backup.

The problem

Here's where the problem occurs: every time I try to restore my files from the backup, there are four files:

  • vmlinuz
  • initrd.img.old
  • vmlinuz.old
  • initrd.img

...that return the error cp: cannot create symbolic link '/mnt/new_boot/./<FILE_NAME>': Operation not permitted.

I'm wondering what the best approach is to move forward. I assume I cannot expect my system to boot without these files. Is there a way to successfully copy them over? If not, is it safe to create new symlinks with the same names, pointing to the relevant versions of vmlinuz-VERSION-generic and initrd.img-VERSION-generic? If I take that approach, what permissions do those files require? Or is it better to somehow restore from a Ubuntu Live USB? I'm a bit out of my depth here; any help is appreciated.

Raffa avatar
jp flag
Two things ... One is strange: `/boot` partition on FAT ... And the other is a fact: FAT doesn't support symbolic links ... Am I missing something here?
Alexander Nied avatar
in flag
@Raffa - yes, I was starting to notice the same thing as I was trying to create my own symlinks based on [Jos's advice below](https://askubuntu.com/a/1469404/651576). However, I just verified from previous screenshots I took before formatting that the boot partition _was_ previously formatted FAT32, and contained symlinks, and was happily booting into GRUB as expected before I started down this path. So, I'm not sure what's going on with that...
Raffa avatar
jp flag
How big was that partition's size before you resize it?
Alexander Nied avatar
in flag
`99MB`, which I subsequently sized up to `499MB`.
Raffa avatar
jp flag
There is a slim possibility that you were looking at not `/boot` but rather `/boot/efi` which is actually akin to the FAT family but totally different in function from `/boot` which should be an EXT* family filesystem ... Might this be the case?
Alexander Nied avatar
in flag
@Raffa-- on review, this is 100% the case (-‸ლ) I've always mounted it at `/boot` when swapping Linux installs so I got confused. As you can see I'm out of my area of knowledge by quite a bit. Would you be able to point me to the appropriate resources for troubleshooting now that we know I've mismatched partition types?
Raffa avatar
jp flag
Is your boot partition/directory intact? if yes, then recreate the EFI partition https://askubuntu.com/questions/1394708/accidentally-deleted-efi-partition-system-is-still-running and you should be good to go ... You can do that from a live USB as well.
Bodo avatar
pt flag
How exactly did you create the backup, how exactly do you try to restore it? Please add this information to the question.
uz flag
Jos
I was under the impression that we were talking about a system that was restored from backup. Obviously a Linux `/boot` partition can't be formatted as FAT32. Should I remove my answer?
Alexander Nied avatar
in flag
@Jos — might still be useful for visitors to the post. Although given that I was on the wrong path all along I might delete the question. I'll probably wait until I actually resolve the issue to determine whether or not there is anything useful I can contribute to the site, or if it is just cruft that should be removed. Thanks for weighing in, either way!
Score:0
uz flag
Jos

You will need to create the links yourself as root.

Being links, they will automatically have the correct permission lrwxrwxrwx. There is no reason this approach shouldn't work.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.