I am using NVMe on PCi card for my system but my hardware cannot boot from NVMe so the /boot/ and boot/efi partitions are installed on an USB stick which is installed internally to avoid accidental removal.
This arrangement works well but when I set it up I used a rather large and dual sized USB which I now need back. I have a new smaller USB stick ready to exchange and thought it would be easy but no such luck. Even though the large USB only has two partitions:-
The empty space gets in the way and frustrates all my efforts to clone only the actual partitions using dd. I cannot find any suitable examples. Since the efi partition is on a dos format is there also lurking an MBR on the USB?
Please could somebody help me with this. I really do not want to do a new installation at this stage just to create a new boot USB!
Budge.
Plug in your new USB, partition it and format it. Maybe use Yast to create the two partitions, but set it to not mount them.
Then manually mount the partitions, and copy the files over. Then unmount again.
Next you should unmount the existing “/boot/efi” and “/boot”. Mount the new partitions in their place. Then run Yast bootloader. Change something in Yast bootloader, maybe change the timeout by 1 second. Yast should then reinstall booting in your new partitions.
Finally, edit “/etc/fstab” for the new device. The UUID of the partitions will be different from what you were using before.
Once that is changed, run “mkinitrd” so that the initrd gets any changed UUID information.
Then try rebooting with the new USB and see how that works.
Hi nrickert, many thanks. There is one issue, to access the internal USB I have to power down and remove fan frame so it is not easy to do the swap.
What I am thinking is to swap the two sticks when machine is off, putting existing USB stick in front USB socket and new USB into the internal slot. I hope that I can then boot the system from the original USB but in a front slot leaving the new USB in the internal position.
If this works I should be OK to do the rest from terminal. Does that sound like the right approach?
I don’t know your hardware, so I cannot be sure of that.
If all mounting is done using UUID, then it should be fine to plug in the new USB on a USB port, and leave the old one where it is. And if that works, check to be sure that the old one is not actually mounted.
I moved too quickly. I had no trouble booting with the original USB stick in a front slot and with the new USB stick in required internal position. I have embarked upon your task list but have fallen half way through. I thought I had created the new directories on the two new partitions and unmounted the original “/boot/efi” and “/boot” partitions but when I can to try and mount the new partitions I couldn’t mount because the partition couldn’t be found in /etc/fstab. I then had mount point does not exist. I am writin this on my laptop but the subject machine is up and running so will continue this thread from that machine so I can insert code.
alastair@ibmserver3:~> lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 260.7M 1 loop /snap/kde-frameworks-5-core18/32
loop1 7:1 0 32.3M 1 loop /snap/snapd/12704
loop2 7:2 0 32.3M 1 loop /snap/snapd/12883
loop3 7:3 0 93M 1 loop /snap/puddletag-snap/3
loop4 7:4 0 55.4M 1 loop /snap/core18/2128
loop5 7:5 0 65.1M 1 loop /snap/gtk-common-themes/1515
sda 8:0 0 5.5T 0 disk
sda1 8:1 0 5.5T 0 part /mastermedia
sdb 8:16 1 28.9G 0 disk
sdb1 8:17 1 500M 0 part
sdb2 8:18 1 2G 0 part
sdc 8:32 1 115.5G 0 disk
sdc1 8:33 1 500M 0 part /boot/efi
sdc2 8:34 1 2G 0 part /boot
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom
nvme0n1 259:0 0 1.8T 0 disk
nvme0n1p1 259:1 0 1.8T 0 part /var
alastair@ibmserver3:~>
/dev/sdc is the original boot USB stick and /dev/sdb is the new stick with the two new partitions ready.
I then umounted the two original partitions and checked what I had:-
alastair@ibmserver3:~> sudo umount /dev/sdc1
[sudo] password for root:
alastair@ibmserver3:~> sudo umount /dev/sdc2
alastair@ibmserver3:~> lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 260.7M 1 loop /snap/kde-frameworks-5-core18/32
loop1 7:1 0 32.3M 1 loop /snap/snapd/12704
loop2 7:2 0 32.3M 1 loop /snap/snapd/12883
loop3 7:3 0 93M 1 loop /snap/puddletag-snap/3
loop4 7:4 0 55.4M 1 loop /snap/core18/2128
loop5 7:5 0 65.1M 1 loop /snap/gtk-common-themes/1515
sda 8:0 0 5.5T 0 disk
sda1 8:1 0 5.5T 0 part /mastermedia
sdb 8:16 1 28.9G 0 disk
sdb1 8:17 1 500M 0 part
sdb2 8:18 1 2G 0 part
sdc 8:32 1 115.5G 0 disk
sdc1 8:33 1 500M 0 part
sdc2 8:34 1 2G 0 part
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom
nvme0n1 259:0 0 1.8T 0 disk
nvme0n1p1 259:1 0 1.8T 0 part /var
alastair@ibmserver3:~>
I then tried to mount the new partitions and fell down hard!:-
sudo mount /dev/sdb1
mount: /dev/sdb1: can't find in /etc/fstab.
alastair@ibmserver3:~> sudo mount /dev/sdb2
mount: /dev/sdb2: can't find in /etc/fstab.
alastair@ibmserver3:~> lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 260.7M 1 loop /snap/kde-frameworks-5-core18/32
loop1 7:1 0 32.3M 1 loop /snap/snapd/12704
loop2 7:2 0 32.3M 1 loop /snap/snapd/12883
loop3 7:3 0 93M 1 loop /snap/puddletag-snap/3
loop4 7:4 0 55.4M 1 loop /snap/core18/2128
loop5 7:5 0 65.1M 1 loop /snap/gtk-common-themes/1515
sda 8:0 0 5.5T 0 disk
sda1 8:1 0 5.5T 0 part /mastermedia
sdb 8:16 1 28.9G 0 disk
sdb1 8:17 1 500M 0 part
sdb2 8:18 1 2G 0 part
sdc 8:32 1 115.5G 0 disk
sdc1 8:33 1 500M 0 part
sdc2 8:34 1 2G 0 part
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom
nvme0n1 259:0 0 1.8T 0 disk
nvme0n1p1 259:1 0 1.8T 0 part /var
alastair@ibmserver3:~> sudo mount /dev/sdb1 /boot/efi
mount: /boot/efi: mount point does not exist.
alastair@ibmserver3:~>
What I do not know is if the contents of the new USB stick partitions is in place. Not sure how to check this but I think I have made several errors. I have not erased anything from the old USB stick or removed either although they are no longer mounted. I shall avoid a reboot and hope I get help in due course. Please let me know what I should do next!
You seem not to understand themount command. One either provides all the parameters needed to the mount command, or one uses a short form like you do, but then all the parameters are to be found in /etc/fstab.
When you do
mount /dev/sdb1
the only parameter provided is the “device”. So how should a command, that is not clairvoyant know: where to mount (mount point), what type of file system, eventual mount options???
What i don’t follow in spite of the advice from Henk is why the two subject mounts, /boot and /boot/efi are still there when I thought I had umounted them. At this rate I shall end up doing a fresh install because I am not even confident the new stick has the right contents and I cannot access it without shutting down. Will start over in the morning.
I think I am helping. I point you to the place where to read and understand what the mount command needs to perform it’s task. And where it gets that information from: either from the command only, or the from command combined with the fstab.
I can of course try to provide you with exact commands (when i do understand exactly what you are doing) and you can then copy/paste those commands in your system without knowing if those commands will do what you want or if they will destroy your system (I can make typos or other mistakes) because you never check hem with man pages, etc. to protect yourself (and to learn)
Or I can try to point you to documentation that will make you understand how things work and that will help you now and in the future. And of course you can ask me questions while trying to understand that documentation.
You ever heard of what is said about helping poor people? Something like "you can give a hungry person a fish, so he can eat today. You can also teach him fishing, so he can feed himself and his family in the future.
Did you try to read at least the beginning paragraphs of the man page for mount as I suggested? When not, then you stubbornly refuse to learn fishing.