Services Failing after Swapping Backup Drives

Having issues with your DietPi installation, or, found a bug? Post it here.
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

Cool. I have the non plus model. Just 3b
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: Services Failing after Swapping Backup Drives

Post by Joulinar »

some USB Boot information and how to activate

https://www.raspberrypi.org/documentati ... des/msd.md

btw you could move boot partition to a much smaler SD card as well
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

Thanks. I had read through that article on USB booting, but what I still don't understand is if I set the one time programmable memory to enable booting from USB, can I still boot from SD if I wanted to (not saying that I would). I'm a little spooked by the OTP aspect since I have no experience with this sort of thing. I'm guessing it just allows USB boot, but does not kill SD boot capabilities.

Also if I plan to have everything on my USB SSD (boot and rootfs) does the process of getting there look something like this?
  • add program_usb_boot_mode=1 to the end of /boot/config.txt
  • reboot
  • copy userdata back to my SD card so everything is on the SD
  • create an image of my SD card on my Mac
  • burn the image onto my USB SSD
  • plug the USB SSD into my Pi 3b, boot
  • done!?
Will there be any issues with the SD and USB drive UUIDs being different? I would also plan to remove the old USB SSD from the Drive manager and FSTAB entries before trying to use it as the boot/rootfs drive (it was previously my backup and userdata drive).

Last question, can I use a samba shared drive as the location for my dietpi backups, or is that not possible because of permissions/ownership limitations for network shares?
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: Services Failing after Swapping Backup Drives

Post by Joulinar »

unfortunately I'm not able to answer the question as I have a 3B+ only where USB boot is working ootb.
But I would expect to have both working once activated. But it might be better to verify and have this question raised on RPi Board. Just in case.

Yep if you swap from SD to USB, you need to adjust UUIDs within /etc/fstab

Recommendation would be to start with a clean install in our SSD to avoid issues or side effects
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

I found some answers in the Raspberry forums here - https://www.raspberrypi.org/forums/view ... p?t=175630

Looks like booting from SD is still a possibility, so I'll plan to move forward with setting the OTP memory to allow USB booting on my Pi 3b.

I wouldn't have a problem updating UUIDs in the /etc/fstab, but since you mention it would be recommended to start from a clean install, would that mean reinstalling and reconfiguring every program I'm running? Is there no clean way to keep what I've got? Would restoring from a backup to a fresh install on the USB SSD be better than trying to migrated to the USB SSD from the SD?

I'm currently running:
  • Plex
  • Nextcloud
  • PiHole
  • VPN
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: Services Failing after Swapping Backup Drives

Post by Joulinar »

well you could give it a try to change UUIDs in the /etc/fstab. if it's not working, you still would have the SD as backup.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

Sounds good. I’ll try it out and post the results. Appreciate all the help!
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

Here's how it all went down.
  1. added program_usb_boot_mode=1 to the end of /boot/config.txt
  2. rebooted
  3. copied userdata back to my SD card so everything is on the SD
  4. copied userdata back to my SD card so everything is on the SD
  5. created an image of my SD card on my Mac
  6. burned the image onto my USB SSD
  7. reviewed /etc/fstab - since I burned the SD images to the USB, the PARTUUID numbers were the same - no change required
  8. pluged the USB SSD into my Pi 3b and powered on
Unfortunately nothing happened after that. The Pi didn't boot off the USB at all and the lights on the USB>SSD adapter never even blinked.

I'm not sure why. I know some SSDs are not compatible, but everything here seemed to be set up properly. More info on this further down.

Thinking I'd go for the next best setup I did the following:
  1. removed the USB SSD
  2. inserted the SD card
  3. booted just fine
  4. formatted the USB SSD
  5. used Drive-Manager to transfer RootFS to the USB SSD
  6. manually transferred user-data from the SD ext4 partition to the USB SSD
  7. rebooted and everything works
I somewhat foolisly didn't run vcgencmd otp_dump | grep 17: after setting the USB boot option in config.txt, because I did check the config.txt file and saw the option was appended properly before rebooting. However now when I run the vcgencmd command it doesn't give me the output of 3020000a and instead outputs 1020000a, indicating that the USB boot option failed to be set in the OTP memory. If that's the case, that explains one reason why USB booting would have failed. When I look at /boot/config.txt the program_usb_boot_mode=1 is no longer there :? . I suppose I could do the following to try it again.
  1. make a new backup of the boot only SD card
  2. restore the old full OS SD card image to the SD card
  3. boot off the SD card
  4. try to set the USB boot parameter again
  5. confirm it is set
  6. copy RootFS to the USB SSD again
  7. try booting again
I also have a 1GB SD card that I'd be fine using for the boot drive. How would I go about copying the current boot drive over to it? I assume I'd again need to change FSTAB (or maybe I could create an image of the current boot SD which should be small now, and restore it to a smaller SD ... or would it image the full 32GB of my card. I've used PiShrink before to get image sizes down and downgrade cards, but not sure that works with a boot partition only on Dietpi.) Maybe putting both SD cards in as external storage on a different Pi would allow me to rsync the boot drive and then just update FSTAB on the USB SSD to use the new SD card's boot partition UUID. Decisions decisions.
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: Services Failing after Swapping Backup Drives

Post by Joulinar »

Hi,

I guess this is what you need to move boot fs to a smaller SD card 8)

viewtopic.php?p=21604#p21604
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cdlenfert
Posts: 28
Joined: Fri Mar 29, 2019 5:42 pm

Re: Services Failing after Swapping Backup Drives

Post by cdlenfert »

Quoting myself here:
I somewhat foolisly didn't run vcgencmd otp_dump | grep 17: after setting the USB boot option in config.txt, because I did check the config.txt file and saw the option was appended properly before rebooting. However now when I run the vcgencmd command it doesn't give me the output of 3020000a and instead outputs 1020000a, indicating that the USB boot option failed to be set in the OTP memory. If that's the case, that explains one reason why USB booting would have failed. When I look at /boot/config.txt the program_usb_boot_mode=1 is no longer there :?
I didn't realize the USB boot option should be set in DietPi-Config > Advanced Options. I had tried editing /boot/config.txt as mentioned in the Raspberry Pi forum post. Once I used the DietPi-Config option and rebooted the USB option was set successfully. Now to try again and see if USB boot can work.
Post Reply