I like that BtrFS is self-healing and supports compression, but I’m not sure how to use it on removable drives (5TB USB3 backup drives). I mean, normally one uses fstab to declare compression use, but external drives aren’t normally included in fstab. I normally use Dolphin auto-connection-detection to mount these drives, but that doesn’t give the options for BtrFS during the mount process. Is there a standard way to do this (KDE)?
As a second question, I’ve noticed that there are two options when creating drives: “label” and “name.” Gparted supports both of these, but only during creation of a new partition table. Label and name both need to be declared as the same or else Dolphin doesn’t give a connection between “Devices” and “Removable Devices” in the “Places” panel (this may be a “bug”?). I guess my question is about the optimal way to set/update both ‘label’ and ‘volume’ on a removable storage device so that I don’t have to go back and create a new partition table (with Gparted) to get these synched (for non-confusing use in Dolphin). I hope that’s making sense…
I realize both these questions may be affected by LEAP version number - and if they are, please mention it!
Hi
Well all you need to do is ensure it’s finished writing (issue the sync command and let it finish before unplugging) before unmounting, treat any device as removable, or any removable as not… it’s just a ‘device’ connected to the computer interface, SATA, USB, eSATA etc… along with a mount point. I can hot swap or unbind SATA devices here, does that mean their removable when physically mounted in the computer?
Hi Malcom - I learned about “sync” and USB’s a while ago (from this forum) - it’s a pretty big, but avoidable, gotcha (at least in KDE) for dummy (overworked? simple?) folks like me (but I’ve finally trained myself on this!). I was noticing that if label/name on the USB device were both well-defined, then the mount path in Dolphin (and in the file tree) uses that name persistently (rather than the big device ID string). This minimizes confusion (and associated errors) for brain-challenged multi-taskers like moi. Now the only question is how to make sure compression is turned-in when a BtrFS USB drive is mounted (in Dolphin). If a drive has a persistent label/name combination, maybe that could be done in fstab? I guess I could try to bing if that’s possible.
Hi
Yes, look at using the likes of the UUID to idenify your disk device, look at the system udev rules (/usr/lib/udev/rules.d/) then put your rule in /etc/udev/rules.d/ and should be good to go.
I doubt you should need to know much about formatting and mounting a removable drive…
I don’t think it makes any sense for a removable drive to be a subvolume, you’ll likely want to create a new BTRFS volume for anything removable.
Ordinarily, compression should be set as a mount option, I would expect not in a udev rule but maybe in your Dolphin connection string (at least that’s how I’d approach it)…
Thank you - I guess I also need to research “fstab mount USB drive” - that might find something useful. Now that I think about it, it seems like a good idea not to mess around too much with KDE/Dolphin configurations because those may go away on updates, recoveries, etc. But fstab is almost always something you mess with, even between distros, and it’s really standardized. Still, making sure name/label are the same (when creating a partition table on a USB drive) is also a more or less permanent way of avoiding at least some of the confusion that can crop up in GUI linux interfaces (KDE/gnome/…) for removable devices. I remember when “by-ID” replaced /dev/sdaX, etc., way back in - what? OS11.x?
Not too much of a problem for Wizards, Gurus, and Shamans, but a headache for simple folk like myself. rotfl!
I still have to use MAN pages to be able to run diff! lol!lol!
(…though I did finally learn vi enough for survival when necessary!) rotfl!
Thanks again, Karl - it looks like the fstab method might work but I’m not sure since my USB drives are encrypted with LUKS (using the opensuse partitioner).
OK, after messing around for a while - here is what I came up with which seems to work just fine (at least under OpenSuSE):
Create a** new Partition Table** with gparted on empty USB device - set both “label” and “name” to be the same (I used BtrFS-3) - also format the drive BtrFS. Apparently, in order to get label and name the same, you have to use gparted. (It may not be possible to do this in the OS YaST partitioner.)
Open **YaST Partitioner **and edit the new USB device.
Choose options: Format Partition BtrFS; encrypt partition; mount (to create a working fstab entry) to location (I used: /run/patti/BtrFS-3) - also be sure to add fstab options: nofail,noauto
(Also choose mounting by uuid - I think that’s default - I also selected “mountable by user” - this may not be necessary)
I also added the fstab options: compress=lzo
It will ask for encryption password
Finish / OK …
After this, the drive should be formatted and fstab modified. Here’s my fstab afterward:
Now, in Dolphin, it behaves just like any other (LUKS encrypted) USB drive you insert. EZ to mount, and it maintains it’s label as BtrFS-3 in the Dolphin “places” panel.lol!
UNFORTUNATELY - I have no idea where the UUID in that fstab line came from. When I use blkid to correlate an identifiable UUID with the device mounted by fstab - the UUID listed in fstab doesn’t appear. (!!!)
So it seems YaST partitioner creates a UUID somehow. Is the YaST-created UUID an alias for a luks-UUID? I don’t know.
I guess this means you may not be able to edit fstab yourself and create an entry using the UUID which utilities like blkid give you.