Announcement

Collapse
No announcement yet.

Formatting an External Drive With BTRFS?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Formatting an External Drive With BTRFS?

    I did a lot of reasearch and decided to stick with BTRFS. I'm currently looking to get into becoming more knowledgable about it and am looking into using the compression feature to compress my external USB HDDs.

    I'm interested in formatting a 100GB USB drive.

    I tried a tutorial from a few years ago, and it's giving me some mixed results (The drive appears to be read-only for some reason in Dolphin, no idea why)

    From the beginning:

    Code:
    [FONT=monospace][COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ sudo mkfs.btrfs /dev/sdc1 -L ELYSIUM -f                                               
    btrfs-progs v4.15.1 
    See http://btrfs.wiki.kernel.org for more information. 
    
    Label:              ELYSIUM 
    UUID:               61c1cad3-a450-44d7-8f31-7561fd644c32 
    Node size:          16384 
    Sector size:        4096 
    Filesystem size:    111.79GiB 
    Block group profiles: 
    Data:             single            8.00MiB 
    Metadata:         DUP               1.00GiB 
    System:           DUP               8.00MiB 
    SSD detected:       no 
    Incompat features:  extref, skinny-metadata 
    Number of devices:  1 
    Devices: 
     ID        SIZE  PATH 
      1   111.79GiB  /dev/sdc1[/FONT]
    Followed by:

    Code:
    [FONT=monospace]sudo mount -o compress=zstd /dev/sdc1 /media/sarah/ELYSIUM
    [/FONT]
    This causes the ELYSIUM drive to appear in dolphin's devices tab in the system's toolbar, but when I go to it, it is read-only and cannot be written to by anyone but root. Is there something that I'm doing wrong? What's the appropriate way to format this? Do I need to modify fstab? I'm not really sure what to do from here.

    #2
    You probably just need to set the ownerships/permissions for the BTRFS filesystem.

    There are a couple of options depending on what kind of access you wish to have, the simplest is to set the ownership of the filesystem to your user (sarah), which should give wrtie access to you (but to no other user, except root, of course).

    While the filesystem is mounted on /media/sarah/ELYSIUM, run
    Code:
    sudo chown -R sarah:sarah /media/sarah/ELYSIUM
    (You only need to do this once, ownerships/permissions are stored within all POSIX filesystems so they survive remounts...including different mount points)

    If you need to give write access to other (or all) users, a better solution is to modify the permissions with "chmod". If you need to set more advanced access, post back with your needs and we'll likely be able to help with that as well.
    Last edited by kubicle; Jan 08, 2019, 12:00 AM.

    Comment


      #3
      Moved to BTRFS subforum.

      Kubicle points out the answer to your access question. As far as compression is concerned, btrfs compresses in a transactional fashion. What that means is, you mount the file system with a particular compression option, and each file accessed after that is compressed using that method. If you mount later without compression the files become uncompressed as you access them.

      Here's a very well written wiki on it: https://btrfs.wiki.kernel.org/index.php/Compression

      The only caveat I an aware of is ZSTD cannot be used on a boot file system due to some grub incompatibility - at least last time I tried that.

      Please Read Me

      Comment

      Working...
      X