Changing external HDD

Hello! My RasPi runs PiHole, Unbound, Wireguard and Nextcloud.

I wanted to upgrade my external HDD from one that’s powered by the Pi to an HDD which has its own power. To do the change, I did the following:

  1. Unplug the old HDD
  2. Plug old HDD and new HDD in my windows pc
  3. Move data from old to new HDD (this took about 12 hours, so I’d like to NOT move stuff to the new HDD again, if possible!)
  4. Plug new HDD in

I didn’t expect it to work that easy, and it didn’t :smiley: The Pi didn’t even boot, only after I attached the old HDD again.
Checking lsblk, it seems like the device isn’t mounted:

root@DietPi:~# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda           8:0    0  1.8T  0 disk
└─sda1        8:1    0  1.8T  0 part /mnt/extern
sdb           8:16   0  1.8T  0 disk
├─sdb1        8:17   0   16M  0 part
└─sdb2        8:18   0  1.8T  0 part
mmcblk0     179:0    0 29.7G  0 disk
├─mmcblk0p1 179:1    0  256M  0 part /boot
└─mmcblk0p2 179:2    0 29.5G  0 part /

Is there a way to make the new HDD behave like the old one? Could I unmount the old one and mount the new one in the same place? It has the same files, after all. Or do I have to switch dietpi-userdata to a new folder?

You’d better copy the files from old to new disk on dietpi.
There is dietpi-sync for that. Then remount the new disk under the mountpoint of the old disk.
https://dietpi.com/docs/dietpi_tools/#dietpi-sync

what data are located on the old disk? The dietpi user data directory only? Or other files as well? If it is the dietpi user data directory, you could use drive manager to select the new drive for that location.

And yes, it’s not a good idea to copy data from a Linux system on a Windows host :smiley:

Just to be clear, I’ll mount the new one, dietpi-sync everything, then unmount the old one, then mount the new one in the old ones location? There’s no way to use the data that’s on the new one?


Yeah, just the “dietpi_userdata” folder with Music, Pictures, Video, and so on in it.

Go to drive manager, select the new drive and check the option to host the user data directory. This should start the copy process

1 Like

Thanks, this seems to work! I had to format the new HDD (wrong file system), but now the userdata gets send. Now I play the waiting game :smiley:

ok keep it running and let us know once finished

Up and running, without problems. Thank you very much, again!

perfect

5 posts were split to a new topic: Rock64, SSD on USB3 not working