Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4978

Beginners • Re: Reinstall raspian with an existing NAS

$
0
0
Raspian or Raspberry Pi OS? They are not the same thing. Instructions below assume RPiOS.

Is the OS on the RAID array or not? Or on a partiton on one of the same drives that isn't part of the array? Or a device exclusively used for the OS?

Hardware or software RAID?

Use entirely at your own risk

If the OS is not on the RAID array, install a new OS to a new SD card (or whatever boot media you're using), boot from it, update it, install any packages you need, copy the config and user files from old to new (section 12.10 of Building A Pi Based NAS may help with that).

If the OS is on the RAID array (or a a drive shared with it, or with anything else) things get ... interesting:
  1. Back up your boot and root partitions.
  2. Verify that you backup is correct.
  3. Write the new OS to a new SD card.
  4. Boot from it
  5. Update and install packages
  6. Now comes the fun bit:
    1. Mount the old root partition e.g. on /mnt
    2. Delete everything in it
    3. Copy the new root partition to the old one e.g.

      Code:

      sudo rsync -axrvH / /mnt
    4. Unmount the old root partition
    5. Mount the old boot partition e.g on /mnt
    6. Copy the new boot partition to the old one e.g.

      Code:

      sudo rsync -axrvH /boot/firmware /mnt
      For bookworm. For Bullseye and earlier the source is just /boot
  7. Shutdown
  8. Remove new boot media
  9. Boot
  10. Restore config and user files from back up

Though, fankly, you'd make life much easier if you keep the OS partitions (boot and root) on a dedicated device.

Statistics: Posted by thagrol — Mon Feb 05, 2024 12:08 am



Viewing all articles
Browse latest Browse all 4978

Trending Articles