Announcement

Collapse
No announcement yet.

btrfs: re-sizing a partition with gparted - info, not question...

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

    btrfs: re-sizing a partition with gparted - info, not question...

    It appears gparted now supports btrfs re-sizing of a partition AND filesystem - at least the version in 14.10.

    I needed to add a standard partition on my laptop so I shrunk my btrfs filesystem manually then launched gparted to shrink the partition and lo-and-behold, gparted notified me that the filesystem on the btrfs partition did not fill the space available and had the option to expand it to fill the space! Neato!

    Since I had already done the shrinkage of the filesystem, I just shrunk the partition to match it and created 2 new ext4 partitions instead. The whole operation took less than 2 minutes, but it was on an SSD which helps alot..

    http://gparted.sourceforge.net/features.php

    Please Read Me

    #2
    Btrfs is looking better and better all the time. Have you ever experimented with using Btrfs file systems directly on the disk without partitions? I know this is possible. I wonder how the system and applications would react given the lack of traditional partitions on the disk.

    Comment


      #3
      Yes, I have two pairs (2 HD's and 2 SSD's) running full device formats in standard multi-device mode (RAID1 meta and RAID0 data). It is functionally no different than using a partition. You just mount /dev/sda vs. /dev/sda1, etc. or use the UUID as normal.

      The one thing not yet resolved for btrfs is dynamically allocated storage - like virtual drives and swap partitions. I just use an ext4 partition on a spare drive to hold my VDI drives and use standard swap partitions.

      I don't know for a fact but I assume the btrfs formatting begins at 2048 to leave room for grub. I haven't attempted a grub install to a full disk btrfs drive yet.

      Please Read Me

      Comment


        #4
        As well as btrfs there's also xfs

        Comment


          #5
          Originally posted by SteveRiley View Post
          Have you ever experimented with using Btrfs file systems directly on the disk without partitions?
          That experiment has been running for almost 4 years here, with zero lost data. I set up a pair of WD1000 hdds in 2010 with a BTRFS filesystem made directly on the devices, and then mounted that filesystem as /mnt/DATA and keep my user data there. After 3 years of running 24/7/360 one of the original drives started spitting an occasional error, so I bought a new pair last year, installed the btrfs filesystem on them, copied my data over, and retired the original drives. Today it looks like this:

          Code:
          root@imerabox:/# blkid -c /dev/null -o list
          device                              fs_type       label          mount point                             UUID
          ---------------------------------------------------------------------------------------------------------------------------------------------
          .
          .
          /dev/sde                            btrfs                        (in use)                                2bbc4079-e05d-43a3-865b-5b3d3f4af0f5
          /dev/sdd                            btrfs                        (in use)                                2bbc4079-e05d-43a3-865b-5b3d3f4af0f5
          and

          Code:
          root@imerabox:/# df -h
          Filesystem      Size  Used Avail Use% Mounted on                                                                                              
          .
          .
          .                                                                                             
          /dev/sdd        1.9T  574G  1.3T  31% /mnt/DATA

          Comment


            #6
            Although I am using btrfs as the fs on the Kubuntu partition of my HD, it has worked so faultlessly and is so easy to use that I'm considering adding "btrfs" to my middle name!
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Originally posted by oshunluvr View Post
              The one thing not yet resolved for btrfs is dynamically allocated storage - like virtual drives and swap partitions. I just use an ext4 partition on a spare drive to hold my VDI drives and use standard swap partitions.
              Dynamically allocated disks for virtual machines will work properly with Btrfs if you disable copy-on-write for the appropriate directories. For example:
              Code:
              chattr +C ~/virtualbox
              Yes, type a + to disable CoW. Note that you need to set this on the directory before you begin placing files there. If you already have files in the directory, then do this:
              Code:
              mv ~/virtualbox ~/vbsave
              
              mkdir ~/virtualbox
              
              chattr +C ~/virtualbox
              
              cp -rv ~/vbsave/* ~/virtualbox
              
              rm -rv ~/vbsave
              Now every file in the newly-created ~/virtualbox directory will carry the no-CoW attribute, which allows dynamically-allocated storage to behave without going through unnecessary CoW-ing.

              If you're using VMware or any other kind of virtualization, the same advice applies. Be sure that you aren't running your virtualization system when you move these files around, of course
              Last edited by SteveRiley; Jan 10, 2015, 10:13 PM. Reason: clarified: for VMs, not for swap

              Comment


                #8
                Steve, I've been using Linux since 1998 and sometimes you make me feel like a total noob!
                It's nice to be able to borrow your brain like this. Oh, don't get old ... It sucks.
                Last edited by GreyGeek; Jan 10, 2015, 01:49 PM.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  Since GG led into this, a thought I keep having (for S-R) is HOW do you learn and know all this?!
                  I mean, if there were a textbook, well, many of us have mastered many a technical textbook, and we would, in short order. But to my knowledge, there is no single such tutorial source. Anyway, I am also impressed.
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    Originally posted by SteveRiley View Post
                    A way to get these kinds of files to work properly on Btrfs is to disable copy-on-write for the appropriate directories. For example:
                    Code:
                    chattr +C ~/virtualbox
                    Yes, type a + to disable CoW. Note that you need to set this on the directory before you begin placing files there. If you already have files in the directory, then do this:
                    Code:
                    mv ~/virtualbox ~/vbsave
                    
                    mkdir ~/virtualbox
                    
                    chattr +C ~/virtualbox
                    
                    cp -rv ~/vbsave/* ~/virtualbox
                    
                    rm -rv ~/vbsave
                    Now every file in the newly-created ~/virtualbox directory will carry the no-CoW attribute, which allows dynamically-allocated storage to behave without going through unnecessary CoW-ing.

                    If you're using VMware or any other kind of virtualization, the same advice applies. Be sure that you aren't running your virtualization system when you move these files around, of course
                    From the btrfs wiki:
                    Does btrfs support swap files?

                    Currently no. Just making a file NOCOW does not help, swap file support relies on one function that btrfs intentionally does not implement due to potential corruptions. The swap implementation used to rely on some assumptions which may not hold in btrfs, like block numbers in the swap file while btrfs has a different block number mapping in case of multiple devices. There is a new API that could be used to port swap to btrfs; for more details have a look at project ideas#Swap file support.
                    A workaround, albeit with poor performance, is to mount a swap file via a loop device.
                    So for now, I'll stick to a swap partition. Besides with 4.5TB on my desktop it's not like I'm running low on space... lol
                    Last edited by oshunluvr; Jan 10, 2015, 04:35 PM.

                    Please Read Me

                    Comment


                      #11
                      True, for swap files, disabling CoW isn't sufficient. Who really uses swap files, though? Partitions make more sense for swap, because they can double as hibernation stores.

                      Disabling CoW is the recommended technique for virtual disk files associated with virtual machines. When I was researching Btrfs in preparation for installing 14.10, I saw this mentioned in a number of places. I edited my earlier post for clarity.
                      Last edited by SteveRiley; Jan 10, 2015, 10:13 PM.

                      Comment


                        #12
                        Oh, and Qqmike... alas, there is no single textbook. I pick up this stuff by reading about the things that interest me. Typically there are wikis or forums or mailing lists for the software I care about. I keep up that way. To avoid drowning in information, I ignore the stuff that doesn't hold my interest -- GNOME, for example. I would be less than a noob with that

                        Comment


                          #13
                          Interesting, Oshunluver.

                          I was curious to see how the newest openSUSE 13.2 looked and ran so I installed it as a guest OS.

                          I was suprised by the following partition notification just prior to formating and installation:

                          Click image for larger version

Name:	openSUSE_partitions.png
Views:	1
Size:	11.6 KB
ID:	642683

                          In a 32GB dynamic partition (non-CoW) it creates an sda1 2GB swap file, an sda2 root volume of 12.5GB using btrfs, an sda3 /home volume of 17.45GB using xfs and the rest of the partition is made of fourteen btrfs subvolumes on sda2. I've never encountered that kind of partition split using swap, btrfs and xfs.
                          Last edited by GreyGeek; Jan 11, 2015, 06:47 PM.
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment


                            #14
                            Originally posted by SteveRiley View Post
                            True, for swap files, disabling CoW isn't sufficient. Who really uses swap files, though? Partitions make more sense for swap, because they can double as hibernation stores.

                            Disabling CoW is the recommended technique for virtual disk files associated with virtual machines. When I was researching Btrfs in preparation for installing 14.10, I saw this mentioned in a number of places. I edited my earlier post for clarity.
                            Ah, having re-read your post I see your point. If (when, duh) I reconfigure I'll give that a go.

                            Please Read Me

                            Comment


                              #15
                              Originally posted by GreyGeek View Post
                              Interesting, Oshunluver.

                              I was curious to see how the newest openSUSE 13.2 looked and ran so I installed it as a guest OS.

                              I was suprised by the following partition notification just prior to formating and installation:

                              [ATTACH=CONFIG]5680[/ATTACH]

                              In a 32GB dynamic partition (non-CoW) it creates an sda1 2GB swap file, an sda2 root volume of 12.5GB using btrfs, an sda3 /home volume of 17.45GB using xfs and the rest of the partition is made of fourteen btrfs subvolumes on sda2. I've never encountered that kind of partition split using swap, btrfs and xfs.
                              That is indeed unusual and very interesting. However, that seems somewhat complicated for a default install. Imagine if a noob installed that? But the news is good. I hope/suspect we'll see more distros adopt btrfs to their installers as the benefits become more widely known.

                              I did once contact the Ubiquity devs regarding the btrfs install for Kubuntu and asked for the option to more specifically configure subvolumes at install time. They weren't having any of it at the time. I can't see why I can specify partitions and mount points but not subvolumes.

                              Honestly though, I don't see the reasons for such a spread of the OS. Wouldn't it make snapshots more complicated? And why use XFS at all? Very odd in my view.
                              Last edited by oshunluvr; Jan 12, 2015, 07:08 AM. Reason: more comments

                              Please Read Me

                              Comment

                              Working...
                              X