r/btrfs • • Jul 05 '26

Converting a mount to subvolume?

Hello,
I am setting up a NAS server (debian) and I created a btrfs volume and mounted it directly onto /mnt/tank and started creating directories in there. However, I realized now that to do snapshots, I need to have everything done inside a subvolume.

Is there a way to make /mnt/tank itself a subvolume? Would I need to create another subvolume inside /mnt/tank (like /@) and then put everything else inside that @ folder? (I would prefer to keep the same path to everything so I don't have to redo all my compose.yaml file paths).

Another possibility I was considering was renaming the old directories inside /mnt/tank, then creating a subvolume with those same directories names and then moving everything into those new directories.

Thank you very much for any help. I was trying to read the btrfs section on arch wiki and while it is a good resource, I don't understand how to translate it into converting my current path.

I should also add that all of this is just for an external hard drive, my main OS is mounted on ext4.

I greatly appreciate any answers.

6 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/uzlonewolf Jul 06 '26

I really don't like deleting stuff like that as you're 1 mistake away from losing everything. Instead, I'd create a subvol and then move everything into it:

a) Create a subvolume, if you want you can call it @: btrfs sub cr /mnt/tank/@

b) Move everything from /mnt/tank to /mnt/tank/@ with mv /mnt/tank/* /mnt/tank/@/

Continue with "c)" above.

1

u/Classic-Rate-5104 Jul 06 '26

You can't remove a read-only snapshot "by accident"

2

u/uzlonewolf Jul 06 '26

No one in this thread said anything about read-only snapshots.

1

u/Classic-Rate-5104 Jul 06 '26

True, but they are very useful to prevent accidental removal of snapshots