Announcement

Collapse
No announcement yet.

how to mount my new btrfs formated drive

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

    how to mount my new btrfs formated drive

    I am new to the btrfs, I am trying it out on this box that has 2 hard drives.

    I installed the OS onto the first drive with btrfs. The second drive was formated using gparted after the install to btrfs.

    How do I use the new drive?
    Do I have to mount it in fstab or some other thing?

    blkid gives this for the drive or file system id:
    Code:
    UUID="3dddb32d-50ad-4ed1-bdc2-b1fd9ec6f47f" UUID_SUB="69621638-39e5-4566-8328-0fce69cd1212" TYPE="btrfs" PARTUUID="0000537f-01"

    #2
    Whoops, Never mind. I think I figured it out from this other recent post about btrfs.
    Well actually I am not sure.
    Last edited by anika200; Jan 29, 2015, 10:12 PM.

    Comment


      #3
      hear is a good read and look at all of @oshunluvr's threads on it and related stuff

      https://btrfs.wiki.kernel.org/index.php/Main_Page

      https://www.kubuntuforums.net/showth...ot-How-To-quot

      https://www.kubuntuforums.net/showth...ighlight=btrfs

      VINNY
      i7 4core HT 8MB L3 2.9GHz
      16GB RAM
      Nvidia GTX 860M 4GB RAM 1152 cuda cores

      Comment


        #4
        this one should show you what you need to know to get the right path to mount it in fstab

        Code:
        sudo btrfs filesystem show
        the one you posted looks like your running install

        VINNY
        i7 4core HT 8MB L3 2.9GHz
        16GB RAM
        Nvidia GTX 860M 4GB RAM 1152 cuda cores

        Comment


          #5
          The first device partition is the / drive, the second one is the extra hdd I need to hold data and have formated to btrfs.
          At the moment, I can not write anything to the /dev/sdb1 drive because I do not know why.
          I am guessing that it is not mounted and ready for writing but I am not certain.

          Code:
          lee@lee-H67N-USB3-B3:~$ sudo btrfs filesystem show
          [sudo] password for lee: 
          Label: none  uuid: 168c70e2-2da1-4c80-a013-4dfb0396811f
                  Total devices 1 FS bytes used 33.19GiB
                  devid    1 size 77.03GiB used 37.02GiB path /dev/sda3
          
          
          Label: none  uuid: 3dddb32d-50ad-4ed1-bdc2-b1fd9ec6f47f
                  Total devices 1 FS bytes used 384.00KiB
                  devid    1 size 224.90GiB used 2.04GiB path /dev/sdb1
          
          
          Btrfs v3.14.1
          lee@lee-H67N-USB3-B3:~$

          Comment


            #6
            Originally posted by anika200 View Post
            At the moment, I can not write anything to the /dev/sdb1 drive because I do not know why.
            I am guessing that it is not mounted and ready for writing but I am not certain.
            that would probably be correct.

            befor you add it to the /etc/fstab (so it mounts at boot) try it first .

            do
            Code:
            sudo mkdir /mnt/btrfs
            (you can substitute btrfs with watever you want to call your mount point)
            then
            Code:
            sudo mount -t btrfs /dev/sdb1 /mnt/btrfs
            (again substitute btrfs with whatever you used for the make directory command above )

            can you use it now .

            VINNY
            i7 4core HT 8MB L3 2.9GHz
            16GB RAM
            Nvidia GTX 860M 4GB RAM 1152 cuda cores

            Comment


              #7
              Originally posted by anika200 View Post
              At the moment, I can not write anything to the /dev/sdb1 drive because I do not know why.
              After it is mounted, as per Vinny's guidance, the ownership permissions will be set to root. Using "sudo", make whatever data folders you need on the mounted partition, then set the ownership and permissions for users.

              Comment


                #8
                Originally posted by dibl View Post
                After it is mounted, as per Vinny's guidance, the ownership permissions will be set to root. Using "sudo", make whatever data folders you need on the mounted partition, then set the ownership and permissions for users.
                Humm yes I did forget to mention this ,,,,,but

                Code:
                vinny@vinny-Bonobo-Extreme:~$ cd /mnt
                vinny@vinny-Bonobo-Extreme:/mnt$ ls -l
                total 4
                drwxrwxrwx 1 [COLOR=#ff0000]root root[/COLOR]   84 Jan 30 17:12 btrfs
                drwxr-xr-x 2 root root 4096 Oct 10 22:34 disk
                Code:
                vinny@vinny-Bonobo-Extreme:/mnt$ cd btrfs/
                vinny@vinny-Bonobo-Extreme:/mnt/btrfs$ ls -l
                total 4
                drwxr-xr-x 1 root  root    0 Jan 29 19:57 @data
                drwxr-xr-x 1 root  root   10 Jan 29 16:48 ext2_saved
                drwxr-xr-x 1 vinny vinny 120 Oct 13 23:17 kubuntu
                drwx------ 1 root  root    0 Oct  2 16:55 lost+found
                drwxrwxr-x 1 vinny vinny   0 Jan 30 17:12 New Folder
                I had no problem making "New Folder" in dolphin even though "/btrfs" is owned by root ?

                mount options
                Code:
                vinny@vinny-Bonobo-Extreme:/mnt/btrfs$ cat /etc/fstab
                # /etc/fstab: static file system information.
                #
                # Use 'blkid' to print the universally unique identifier for a
                # device; this may be used with UUID= as a more robust way to name devices
                # that works even if disks are added and removed. See fstab(5).
                #
                # <file system> <mount point>   <type>  <options>       <dump>  <pass>
                # / was on /dev/sda3 during installation
                UUID=f10fe189-1184-4546-bbb2-58a9f0edbf8d /               ext4    errors=remount-ro 0       1
                # swap was on /dev/sda2 during installation
                UUID=aeb8718b-d4a7-4d21-9584-425071e6c6ba none            swap    sw              0       0
                [COLOR=#ff0000]#TB-drive
                /dev/sdb1 /mnt/btrfs    btrfs     rw,relatime,space_cache,compress=lzo     0    0[/COLOR]
                strange.

                VINNY
                i7 4core HT 8MB L3 2.9GHz
                16GB RAM
                Nvidia GTX 860M 4GB RAM 1152 cuda cores

                Comment


                  #9
                  In Vinny's case - his is mounted to /mnt/btrfs which has +rwx for everyone - the whole world.

                  That's one solution, however depending on who has access to your PC or if you care, you may not want the whole world into your data.

                  A better choice IMO would be to create a subvolume on the btrfs partition, give it your user ownership and private permission.

                  For example:

                  Code:
                  mkdir ~/data
                  sudo mount /dev/sdb1 /mnt
                  sudo btrfs subvolume create /mnt/@data
                  sudo chmod o-rx /mnt/@data
                  sudo chown lee:lee /mnt/@data
                  sudo umount /mnt
                  Now you have a subvolume on /dev/sdb1 that belongs only to you. Let mount it to try it out:

                  Code:
                  sudo mount /dev/sdb1 -o rw,relatime,space_cache,compress=lzo,subvol=@data /home/lee/data
                  Your subvolume should now be ready for use.

                  To mount it automatically at boot time; edit /etc/fstab and add this line:

                  Code:
                  UUID=3dddb32d-50ad-4ed1-bdc2-b1fd9ec6f47f btrfs /home/lee/data rw,relatime,space_cache,compress=lzo,subvol=@data 0 0
                  or
                  Code:
                  /dev/sdb1 btrfs /home/lee/data rw,relatime,space_cache,compress=lzo,subvol=@data 0 0

                  Please Read Me

                  Comment


                    #10
                    Originally posted by oshunluvr View Post
                    A better choice IMO would be to create a subvolume on the btrfs partition, give it your user ownership and private permission.
                    This is what I was wanting to do as well, I may have time to work it up today or tomorrow.
                    Thanks to all for the great information, really appreciate it.
                    I am still working through the documents at the moment and will post the results of my endeavors.

                    Comment


                      #11
                      Originally posted by oshunluvr View Post
                      In Vinny's case - his is mounted to /mnt/btrfs which has +rwx for everyone - the whole world.
                      ya I was tired when I posted that ,,,,,,,,,,,,,,,,, I meant to say it was strange that /mnt/btrfs was writable and /mnt/disk was not (for users/everyone) when they were made in the same way (with sudo mkdir)

                      VINNY
                      i7 4core HT 8MB L3 2.9GHz
                      16GB RAM
                      Nvidia GTX 860M 4GB RAM 1152 cuda cores

                      Comment


                        #12
                        Originally posted by vinnywright View Post
                        ya I was tired when I posted that ,,,,,,,,,,,,,,,,, I meant to say it was strange that /mnt/btrfs was writable and /mnt/disk was not (for users/everyone) when they were made in the same way (with sudo mkdir)

                        VINNY
                        Yeah that is odd. The mount target will take the permissions of the mounted filesystem or can be mounted using umask= to change the permissions. I can't imagine how yours got mounted that way. Have you changed your default umask?

                        Please Read Me

                        Comment


                          #13
                          Originally posted by oshunluvr View Post
                          Yeah that is odd. The mount target will take the permissions of the mounted filesystem or can be mounted using umask= to change the permissions. I can't imagine how yours got mounted that way. Have you changed your default umask?
                          no not to my knowledge.

                          just did a test in /mnt

                          Code:
                          vinny@vinny-Bonobo-Extreme:/mnt$ ls -l
                          total 8
                          drwxrwxrwx 1 root root   84 Jan 31 02:49 btrfs
                          drwxr-xr-x 2 root root 4096 Oct 10 22:34 disk
                          [COLOR=#ff0000]drwxr-xr-x 2 root root 4096 Jan 31 15:06 test[/COLOR]
                          not writable everyone

                          and in /btrfs
                          Code:
                          vinny@vinny-Bonobo-Extreme:/mnt/btrfs$ ls -l
                          total 4
                          drwxr-xr-x 1 root  root    0 Jan 29 19:57 @data
                          drwxr-xr-x 1 root  root   10 Jan 29 16:48 ext2_saved
                          drwxr-xr-x 1 vinny vinny 120 Oct 13 23:17 kubuntu
                          drwx------ 1 root  root    0 Oct  2 16:55 lost+found
                          drwxrwxr-x 1 vinny vinny   0 Jan 30 17:12 New Folder
                          [COLOR=#ff0000]drwxr-xr-x 1 root  root    0 Jan 31 15:12 test2[/COLOR]
                          not writable everyone

                          Code:
                          vinny@vinny-Bonobo-Extreme:/mnt/btrfs$ umask
                          0002
                          cat /etc/fstab
                          Code:
                          #TB-drive
                          /dev/sdb1 /mnt/btrfs    btrfs     rw,relatime,space_cache,compress=lzo     0    0
                          VINNY
                          i7 4core HT 8MB L3 2.9GHz
                          16GB RAM
                          Nvidia GTX 860M 4GB RAM 1152 cuda cores

                          Comment


                            #14
                            So unmount it, then check the permissions of /mnt/btrfs, then remount it using:

                            sudo mount /dev/sdb1

                            and check again. Weird...

                            Please Read Me

                            Comment


                              #15
                              Code:
                              vinny@vinny-Bonobo-Extreme:~$ sudo umount /dev/sdb1
                              vinny@vinny-Bonobo-Extreme:~$ cd /mnt
                              vinny@vinny-Bonobo-Extreme:/mnt$ ls -l
                              total 12
                              [COLOR=#ff0000]drwxr-xr-x 2 root root 4096 Jan 29 17:22 btrfs[/COLOR]
                              drwxr-xr-x 2 root root 4096 Oct 10 22:34 disk
                              drwxr-xr-x 2 root root 4096 Jan 31 15:06 test
                              Code:
                              vinny@vinny-Bonobo-Extreme:/mnt$ sudo mount -a
                              vinny@vinny-Bonobo-Extreme:/mnt$ ls -l
                              total 8
                              [COLOR=#ff0000]drwxrwxrwx 1 root root   94 Jan 31 15:12 btrfs[/COLOR]
                              drwxr-xr-x 2 root root 4096 Oct 10 22:34 disk
                              drwxr-xr-x 2 root root 4096 Jan 31 15:06 test
                              vinny@vinny-Bonobo-Extreme:/mnt$
                              yes weird ,,,, the fstab line is correct though

                              Code:
                              vinny@vinny-Bonobo-Extreme:/mnt$ cat /etc/fstab
                              # /etc/fstab: static file system information.
                              #
                              # Use 'blkid' to print the universally unique identifier for a
                              # device; this may be used with UUID= as a more robust way to name devices
                              # that works even if disks are added and removed. See fstab(5).
                              #
                              # <file system> <mount point>   <type>  <options>       <dump>  <pass>
                              # / was on /dev/sda3 during installation
                              UUID=f10fe189-1184-4546-bbb2-58a9f0edbf8d /               ext4    errors=remount-ro 0       1
                              # swap was on /dev/sda2 during installation
                              UUID=aeb8718b-d4a7-4d21-9584-425071e6c6ba none            swap    sw              0       0
                              #TB-drive
                              [COLOR=#ff0000]/dev/sdb1 /mnt/btrfs    btrfs     rw,relatime,space_cache,compress=lzo     0    0[/COLOR]
                              VINNY
                              i7 4core HT 8MB L3 2.9GHz
                              16GB RAM
                              Nvidia GTX 860M 4GB RAM 1152 cuda cores

                              Comment

                              Working...
                              X