I am in the process of changing over to 12.04 from 11.04. I usually preserve my previous working install and do a full new install along side so I don't leave myself computer-less if something goes wrong. Since I have multiple installs on the computer, I tend to keep /home within each install so settings and the like are kept unique. This has the potiential to leave things like documents and downloads scattered all over the place. To prevent this scattering and to reduce the required space for each install (having six separate /homes can use a lot of hard drive space!) I have a large single partition and keep Documents, Pictures, Music, Videos, and Downloads folders on it. Then after each new install, I mount the data partition, remove the default cooresponding folders from my /home directory, and create symlinks to the folders on the data partition.
This time I decided to try something different. Since I am using btrfs anyway I decided to get more into the filesystem's abilities and use subvolumes for these files. The primary functional difference is rather than a symlink, I use mount points defined in fstab for each of the four folders.
Why do it this way? Several reasons;
Easier and more efficent backups: btrfs has subvolume "snapshot" capabilities that you can't do with just subdirectries. Also, by having the file types in different subvolumes I can prioritize backups.
To learn how to do it: This usually is enough reason for me.
Visually consistant: The folders appear as "normal" folders in my home rather than links.
Flexability of the filesystem: btrfs allows on-the-fly (while mounted) expansion and contraction. If you run out of room - simply add in another partition or drive.
HOWTO:
I will skip how to create the initial btrfs filesystem. The link above explains that in enough detail.
Example terminal commands assuming your btrfs partition is /dev/sda5:
Mount the root directory (not a subvolume) somewhere and navigate to it;
Create a subvolume and take ownership of it;
Move your existing files to the new subvolume;
Edit /etc/fstab using your preferred method and add the mount points:
You can use the rootvolume UUID instead of the device name if you prefer.
Mount the new subvolume in the correct place and you're done:
One interesting (and not benefitial) difference is when moving files across subdirectories on a single partition, the file "pointers" are moved but not the actual data. When using subvolumes, the file is actually moved from one subvolume to the other, even if they exist on the same partition. Obviously, this takes quite a bit longer.
Another small downside is you can't share directories this way. A symlink is still the best way to go for that.
I'll likely have more to add as I play with this new setup...
This time I decided to try something different. Since I am using btrfs anyway I decided to get more into the filesystem's abilities and use subvolumes for these files. The primary functional difference is rather than a symlink, I use mount points defined in fstab for each of the four folders.
Why do it this way? Several reasons;
Easier and more efficent backups: btrfs has subvolume "snapshot" capabilities that you can't do with just subdirectries. Also, by having the file types in different subvolumes I can prioritize backups.
To learn how to do it: This usually is enough reason for me.
Visually consistant: The folders appear as "normal" folders in my home rather than links.
Flexability of the filesystem: btrfs allows on-the-fly (while mounted) expansion and contraction. If you run out of room - simply add in another partition or drive.
HOWTO:
I will skip how to create the initial btrfs filesystem. The link above explains that in enough detail.
Example terminal commands assuming your btrfs partition is /dev/sda5:
Mount the root directory (not a subvolume) somewhere and navigate to it;
Code:
sudo mkdir /mnt/data sudo mount /dev/sda5 /mnt/data cd /mnt/data
Code:
sudo btrfs subvolume create @mydocuments sudo chown myuser:myuser @mydocuments
Code:
mv ~/Documents/* /mnt/data/@mydocuments
Code:
/dev/sda5 /home/myuser/Documents btrfs space_cache,compress,subvol=@mydocuments 0 0
Mount the new subvolume in the correct place and you're done:
Code:
sudo mount /home/myuser/Documents
Another small downside is you can't share directories this way. A symlink is still the best way to go for that.
I'll likely have more to add as I play with this new setup...
Comment