Announcement

Collapse
No announcement yet.

Can't Make a Subvolume in Home Folder?

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

    Can't Make a Subvolume in Home Folder?

    I'm trying to make a subvolume in my home folder but I keep getting an error saying that it is not a btrfs filesystem. This is strange because @home exists, so clearly, the disk is btrfs.

    Code:
    [FONT=monospace][COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ btrfs subvolume create ARC 
    ERROR: not a btrfs filesystem: . 
    [COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ sudo btrfs subvolume list / 
    ID 257 gen 405646 top level 5 path @ 
    ID 258 gen 405646 top level 5 path @home
    
    [/FONT]

    #2
    Well, in principle, just because the @home subvolume exists does not preclude your home directory being somewhere else, and your prompt saying "~" could be lying. What do these say:
    Code:
    $ pwd
    $ sudo blkid
    $ findmnt -s
    I ran your command in my home directory successfully. Odd that one can create a subvolume without sudo.
    Regards, John Little

    Comment


      #3
      My home is in it's own subvolume and:

      Code:
      stuart@Precision7730:/etc/NetworkManager$ cd /home
      stuart@Precision7730:/home$ cd stuart
      stuart@Precision7730:~$ btrfs su cr ARC
      Create subvolume './ARC'
      stuart@Precision7730:~$
      No sudo or anything special required. The only difference that sticks out is I have the root volume mounted. Try mounting your root filesystem somewhere (I use /mnt/subvols) and try again.

      Please Read Me

      Comment


        #4
        Interestingly, sudo not required to create it but WAS required to delete it.

        Please Read Me

        Comment


          #5
          Originally posted by oshunluvr View Post
          Interestingly, sudo not required to create it but WAS required to delete it.
          "man mount" (btrfs mount options):
          user_subvol_rm_allowed
          Allow subvolumes to be deleted by a non-root user. Use with caution.

          Comment


            #6
            Interesting tidbit - learn something new every day. Still, I hadn't mounted it so the mount option wouldn't apply if I understand your post correctly.

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              Interesting tidbit - learn something new every day. Still, I hadn't mounted it so the mount option wouldn't apply if I understand your post correctly.
              The mount option refers to the parent filesystem, not the subvolume you're gonna delete, if your subvolumes reside under @home, for example, then if @home is mounted with the mount option (you can remount it with it, or define the option in fstab), the subvolumes can be removed as a user...but use with caution, as advised in the man page.

              Code:
              $ btrfs subvolume create test
              Create subvolume './test'
              
              $ btrfs subvolume delete test
              Delete subvolume (no-commit): '/home/user/test'
              ERROR: cannot delete '/home/user/test': Operation not permitted
              
              $ sudo mount -o  remount,rw,relatime,ssd,space_cache,subvolid=257,subvol=/@home,user_subvol_rm_allowed   /home
              
              $ btrfs subvolume delete test
              Delete subvolume (no-commit): '/home/user/test'
              Last edited by kubicle; Jan 11, 2019, 01:35 AM.

              Comment


                #8
                Ah, makes sense. Thanks for the explanation. It does sound like a dangerous thing to use unwisely. Still, it seems illogical that a user can create a subvolume in their userspace but can't delete it.

                Please Read Me

                Comment


                  #9
                  Here is mine. The pwd is clearly /home/sarah and the /home folder is a btrfs filesystem, so...?

                  Code:
                  [FONT=monospace][COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ pwd
                  /home/sarah
                  [COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ sudo blkid
                  [sudo] password for sarah:  
                  /dev/sda1: UUID="C7BD-3586" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="9b0d847b-7f50-4ad4-b99e-5562481e05a5"
                  /dev/sda2: UUID="029c3c88-8edb-4da0-a741-5d912950e2e1" UUID_SUB="4ad04613-a9e6-49d5-a935-2cb939a5ccee" TYPE="btrfs" PARTUUID=
                  "fc56426c-8241-4db6-9661-24c17f161a18"
                  /dev/sda3: UUID="79F8D858044BC8BB" TYPE="ntfs" PARTLABEL="Windows" PARTUUID="c16c1189-efcf-4dc1-a23c-289c5773ed42"
                  /dev/sda4: UUID="183C4E233C4DFC6E" TYPE="ntfs" PARTUUID="0d356e7f-73d9-49bb-88e7-d2d9512552e5"
                  /dev/sdc1: LABEL="ELYSIUM" UUID="0f834b1e-78a4-4b8b-9528-3b6c3f5ae37b" UUID_SUB="a84c1c8f-8484-404d-b420-777c6b1f0da9" TYPE="
                  btrfs" PARTLABEL="ELYSIUM" PARTUUID="9cc2500a-68ea-4a2e-ba3d-17464271170d"
                  /dev/sde1: UUID="2018-07-25-03-28-48-00" LABEL="Kubuntu 18.04.1 LTS amd64" TYPE="iso9660" PTUUID="418c5dc0" PTTYPE="dos" PART
                  UUID="418c5dc0-01"
                  /dev/sde2: SEC_TYPE="msdos" UUID="0D5F-1DB6" TYPE="vfat" PARTUUID="418c5dc0-02"
                  /dev/sdb1: PARTLABEL="Basic data partition" PARTUUID="419dcac7-a187-468d-bf56-d12ef942f963"
                  /dev/sdd1: PARTUUID="e8c5b11a-01"
                  [COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ findmnt -s
                  TARGET    SOURCE                                    FSTYPE OPTIONS
                  /         UUID=029c3c88-8edb-4da0-a741-5d912950e2e1 btrfs  defaults,subvol=@
                  /home     UUID=029c3c88-8edb-4da0-a741-5d912950e2e1 btrfs  defaults,subvol=@home
                  none      UUID=45f9fe6b-ae81-47c7-bbd7-f9ca4ac66060 swap   sw
                  /boot/efi UUID=C7BD-3586                            vfat   defaults
                  /media/sarah/ELYSIUM
                          UUID=0f834b1e-78a4-4b8b-9528-3b6c3f5ae37b btrfs  rw,noatime,space_cache,compress=zstd,autodefrag,subvol=EternalFields
                  [/FONT]

                  Comment


                    #10
                    Thank you for taking the trouble. I don't understand, if those results are in the same session as the failing subvolume create. I keep thinking there must be something screwy somewhere, like an alias, confusing us.

                    I wonder why you'd want to create a subvolume in your home directory, and why you haven't used sudo. I'm accustomed to always prefacing btrfs commands with sudo; even subvolume list needs sudo.
                    Regards, John Little

                    Comment


                      #11
                      All reasons aside, this still should be doable. Curious what this shows us:

                      cat /etc/mtab |grep home

                      and have you tried creating the subvolume using sudo? Could be some odd permissions issue, but that's not really logical.

                      Please Read Me

                      Comment


                        #12
                        Originally posted by oshunluvr View Post
                        All reasons aside, this still should be doable. Curious what this shows us:

                        cat /etc/mtab |grep home

                        and have you tried creating the subvolume using sudo? Could be some odd permissions issue, but that's not really logical.
                        Sorry, I was on vacation in Florida before the start of the new school semester. This might not be worth persuing, but I ran the Konsole command anyway:

                        Code:
                        [FONT=monospace][COLOR=#54FF54][B]sarah@ConvergentRefuge[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~/Desktop/Indexing/Indexing Temp[/B][/COLOR][COLOR=#000000]$ cat /etc/mtab |grep home[/COLOR]
                        /dev/sda2 /[COLOR=#FF5454][B]home[/B][/COLOR][COLOR=#000000] btrfs rw,relatime,space_cache,subvolid=258,subvol=/@[/COLOR][COLOR=#FF5454][B]home[/B][/COLOR][COLOR=#000000] 0 0[/COLOR]
                        /[COLOR=#FF5454][B]home[/B][/COLOR][COLOR=#000000]/sarah/.Private /[/COLOR][COLOR=#FF5454][B]home[/B][/COLOR][COLOR=#000000]/sarah ecryptfs rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=737970d8c7398e7e,ecryptfs_sig=c5bbfda1f773a1a8,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_un[/COLOR]
                        link_sigs 0 0
                        [/FONT]

                        Comment

                        Working...
                        X