2

I have my system running on a BTRFS partitioned SSD. I understand that some directories within the /home/user/ directory would benefit from being on the SSD, like .local, .config .Applications, etc. In that regard, I feel like keeping them on the SSD. while having the multimedia directories be on different hard drives.

For example, I'd want the Downloads directory to be on a 3TB hard drive, alongside with Pictures and Music, but move Documents on a different 500gb hard drive, some configurations like that.

I decided to start with my 500gb hard drive, I created a BTRFS partition, and added some subvolumes for @documents

Then used fstab to mount the subvolume to /home/documents/ After using chmod and chown to give the mounted directory rw permissions, the directory is now usable, however when I try to delete a file or a directory it warns me that they will be permanently deleted, so there is no .Trash directory anywhere to be found.

What's the best way to do this? Is there a way to create a trash directory for the individual btrfs subvolumes? Would it be better to just move my entire /home directories? Should I use a different filesystem like ext4 instead of btrfs for the media directories? Is there a better way to accomplish this?

2 Answers 2

0

The Trash cannot work properly due to a limitation at kernel level.

You can refer to the following resource: Bug 70831 - Bind mount doesn't allow to trash files and directories.

In other words, there is a function involved during the trashing operations called rename(2) that throws the error EXDEV when its input/output parameters oldpath and newpath are in different mountpoints:

  EXDEV  oldpath and newpath are not on the same mounted filesystem.
         (Linux permits a filesystem to be mounted at multiple points,
         but rename() does not work across different mount points, even
         if the same filesystem is mounted on both.)

Therefore, as also stated in a comment:

[...] this means that one cannot use bind-mounted directories 'normally', because there is no way to 'trash' files from such places, and the only way to delete files is permanent deleting without any possibility to restore such data. And there is not much sense of using bind-mounted directories because of that obscure behavior. [...]

The only thing that you can do is to symlink your folders. If your Download forlder is in /mnt/Data (this is the place where I have it, I use it just for instance), you can:

ln -s /mnt/Data/Download ~/Download

Probably you need to delete ~/Download before symlinking /mnt/Data/Download.

1
  • That did work, there is an arrow on the symlink icons but other than that, it works perfectly. Oct 21, 2020 at 22:58
0

It doesn't really matter which filesystem to use.

You can always move any directories to other disks and make symlinks to them.

For instance, I have my Ubuntu 20.04 system installed to an SSD partition.

I have a HDD mounted to /media/HDD where I have some directories, e.g. Video.

I made a symlink to my user directory by

ln -s /media/HDD/Video ~/Video

I see the Video directory as if it were in my user home directory, but it is stored on my HDD.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .