Trying to clone a partition

If you are not sure how to do, please backup your important data and favorite configs to another disk first before trying dangerous things.

If I understand correctly you want to copy all Manjaro partitions from nvme1 to nvme2, try to follow my points step by step:
(Warning: I haven’t even tried that):

  1. You have 3 current different Manjaro partitions (A EFI partition FAT32, a system partition Btrfs and a swap partition) in nvme1.

  2. Create 3 empty partitions in nvme2.

    1. partition 500 MB FAT32 for /boot/efi when using GRUB.
    2. partition X GB Btrfs for your system and home.
    3. partition 16 GB for swap.
  3. Copy /boot/efi from nvme1 to 1. partition FAT32 in nvme2. I recommend you use rsync to preserve all permissions and timestamps of data. Do not use cp.

  4. How to copy btrfs filesystem from nvme1 to 2. partition Btrfs in nvme2. → Try btrfs send | btrfs receive [HowTo] Copy/Move a subvolume from one partition to another
    you need to copy 4 different subvolumes (@, @home, @cache, @log) to other Btrfs filesystem.

  5. Change UUIDs in /etc/fstab which should match new UUIDs of nvme2.

  6. Run mkinitcpio -P to create current Kernel initramfs and run update-grub for Grub.

I know this is not easy for beginners. I recommend you just install new Manjaro system and copy your data and configuration back. That is easy.

You are right ! There is was an error in the wiki :flushed:

You have to add one more paramter (the path to your mounted volume)

 btrfs device add --help                                                                                                             ✔ 
usage: btrfs device add [options] <device> [<device>...] <path>

    Add one or more devices to a mounted filesystem.

    -K|--nodiscard            do not perform whole device TRIM on devices that report such capability 
    -f|--force                force overwrite existing filesystem on the disk 
    --enqueue                 wait if there's another exclusive operation running, otherwise continue 

:footprints:

Oh, so / has to be added to the end? And if it still doesn’t want to, use -f?

I feel partly responsible for helping this guy out now… xD

@thedatabug I edited my post above to correct the commands.

Thank you all for the advice.

I decided to play it safe and re-install Manjaro to the new drive and copy settings across. It is all mostly working now with the exception of a Steam game that worked before but now wont launch. Anyway easier to fix that than a whole install.

Ive learnt a few things about btrfs that will be useful for the future. And we found an error in the wiki :slight_smile:

Good job!

The funny part is, the btrfs add/remove would have properly done all of that.
I really want to stress that btrf send would also do what you want, if you want to overcomplicate it SIGNIFICANTLY.
Just for future readers so you realize the marked solution works, but is also the most complicated.

Edit

If it is all games on steam, check the symlinks in your home directory, they might point wrong since you made a new install and just copy the files from your old home.
If it is only ONE game, and the rest works, that is not the problem.

I also have a Garuda install that I want to move to my former Manajro partition so I will try the btrfs add/remove there. As I dont mind taking any risks with that one.

Also to explain why I foudn the instructions confusing. I couldnt work out why you would add a drive to a pool and then remove the source drive from said pool and how that would do anything. I would have expected some kind of copy procedure to happen in between those 2 actions.

However, I had an epiphany. And this is for noobs that think like me. I understand it thus. BTRFS works with references to files rather than with the files themselves (its why a backup if a whole system is instant). So adding a drive to a pool is recognizing the new drive as additional storage. BTRFS catalogs this. Then when you remove the source drive BTRFS says Oh I have the references to the files but I no longer have the files so then it copies them over.

That may well be super laymans terms but I think thats how it works.

Also to bedna I chose the solution mainly due to the fact that it recommended what I already did. A reinstall of Manajro and copied settings across.

And Ive sorted Steam too. I was missing gamemode. And one of my game was launched using that.

Shame you cant pick 2 solutions.

Yes, you kinda nailed it.

When you add a volume to the btrfs system, it CAN use that space, the size will increase.
You: “Hey, btrf, use this partition as well!”
btrfs; “ok, wow, lots of extra space for me here”

If you then remove the original partition where all the subvolumes are mounted.
You: “Hey, btrfs, I want you to stop using that partition, I need it for something else”
btrs: “Sure boss, just let me move my s**t out of your way, give me a minute”
and starts moving files in the background

btrfs will take care of your /etc/fstab, detecting it’s a nvme etc and you can just keep using the computer completely normally immediately after issuing the command.

I have never done this, but this is how its supposed to work.

I did the add destination drive and remove source drive thing with my Garuda install. It did copy all the files but it left me with an unbootable system. I tried to rescue said system using chroot and reinstalling grub. Then I ended up with an inaccessable drive which I ended up having to wipe and re-install.

So upshot is it sort of works but it screws up a few things which someone with the correct knowhow would probably be able to rescue. Unfortunately that someone isn’t me.

As the distro here is Garuda it would be improper to discuss it here. Just letting you know the outcome of the little experiment.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.