Hello,
I’m using a 1TB external HDD as external storage and I would like to replace it with an 8TB external HDD.
What’s the safest way to do this migration?
Thanks!
Hello,
I’m using a 1TB external HDD as external storage and I would like to replace it with an 8TB external HDD.
What’s the safest way to do this migration?
Thanks!
Do you use the external HDD as nextcloud-data-dir or as external data in nextcloud?
Please post interesting parts from:
I use it as nextcloud’s data directory.
What exactly do you mean by interesting parts from config/config.php?
The mount point is /media/some_long_serial_number/
File system is btrfs.
How I would do it is image the 1 TB onto the 8 TB and then extend the partition.
Check the btrfs manuals, you can easily do a btrfs replace followed by a btrfs resize max and dont have to care about anything else later on…
Another possibility is to format the new HDD with btrfs (perhaps also other types like ext4) and then copy all files in the same structure from the old HDD to the new HDD. You must the the rights of the files to www-data (nextcloud user). Then you can change the HDDs and mount the new HDD on the same position.
Way too complicated, you dont need to format anything and during the replace process the filesystem is fully accessible.
sudo bash
will open bash as su
btrfs filesystem show
will list you the current filesystem, you will need the deviceid.
btrfs replace start 1 /dev/sdb /media/myCloudDrive/ -f
This is how i did it, this moves the complete content of the old drive (1) to the new device (sdb), /media/myCloudDrive/ is the mountpoint of the filesystem, -f means to force overwrite any content on the target drive.
With
btrfs replace status
you can get the progress, the operation will take a while and after that a
btrfs filesystem resize myCloudDrive max
will expand the filesystem onto the full drive
Ok, I’ll give this a try.
Thank you!
Keep us informed… ah, and dont forget to replace myCloudDrive with that long serial number you mentioned
Hey, sorry I haven’t managed to do this yet because my 8TB HDD hasn’t arrived yet. There seem to be a lot of delays during this crazy period.
But I promise I’ll let you guys know how it went when I finally do it.
Thanks for asking!
Ok, my 8TB HDD finally arrived and I began the process of migrating my data to it.
Unfortunately, it was not a straightforward operation.
Long story short:
I’m using NextcloudPi, so I figured it would be easier to do the migration via the integrated backup/restore tools that it has integrated in it. It was not.
I’m going to skip the problems (unless anyone is interested) and just say what I did that actually worked:
That’s all!
Hopefully this helps someone in the future.
Thanks a lot for your support guys!
You definitely would have saved you a lot of trouble by using btrfs replace, this is a filesystem level operation and seamless, you could even have used your nc during that operation, i have done exactly that two weeks before your first post.