Announcement

Collapse
No announcement yet.

Guide to BTRFS install?

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

    Guide to BTRFS install?

    After succesfull USB test i now started planning hard disk install.

    I've searched for a few guides on how to install on BTRFS, but they are all quite old.

    1. s there a good one for desktop PC not server?

    2. Is it true BTRFS needs empty disk space at the start of the drive (one of the guides mentions that BTRFS needs about 1 Gb or so unnalocated disk space available at the start of the drive)? I don't think i have any since windows is now installed from the start of the drive..

    3. Does BTRFS with it's different naming of partitions interfere with any standard skripts?

    Partitioning of the OS drive is MBR with Windows XP taking about 500 GB of a 1 TB drive. about half of the drive is empty and this is where the Kubuntu could go.
    The only other option would be getting a new drive for the Linux OS. but of course that costs money.

    #2
    Btrfs does not need empty space at the start of a drive.

    However, I have run in to an occasional issue with with MBR disks partioned with the windows XP era software.

    Older software starts the first partition on sector 63, which may not allow the grub bootloader to fit full in the empty space. This is particularly important in complex installs, which may be the case for btrfs.

    This solution is to create a small 1gb /boot partition formatted to ext4, which can then hold grub.

    If you wish more guidance, start the Live USB. Open a terminal and enter the command

    Code:
    sudo parted -l
    Then paste the output here for us.

    Sent from my ONEPLUS A5010 using Tapatalk
    Last edited by mr_raider; Dec 23, 2017, 11:20 AM.

    Comment


      #3
      There are excellent guides to Btrfs by Oshunluver and others on this forum. Just search for Btrfs and note Oshunluver's posts.
      The best source of Btrfs info is the Debian wiki:
      https://wiki.debian.org/Btrfs
      which was last updated on Nov 11, 2017.

      You could install directly to the raw disk (/dev/sda) without creating /dev/sda1 partition, but I'd advise against that unless you are going with Oshunluver's approach. When you finish installing be sure that /etc/fstab contains the UUID hd designation and not a /dev/sdX assignment.
      This is because if you add another drive and you've used /dev/sdX1 to assign the HD in fstab they could switch /dev/sdX designations.

      For a standard kind of install to one disk with no intent to create a RAID or to install multiple distros, the best procedure is to delete all the existing partitions on the HD and then create one partition, sda1, and install to it using "/" as the mount point and Btrfs as the filesystem. The installation program will take care of the rest.
      No swap partition is needed because Btrfs does not use swap partitions, nor swap files.
      Last edited by GreyGeek; Dec 22, 2017, 02:15 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


        #4
        Originally posted by GreyGeek View Post
        For a standard kind of install to one disk with no intent to create a RAID or to install multiple distros, the best procedure is to delete all the existing partitions on the HD and then create one partition, sda1, and install to it using "/" as the mount point and Btrfs as the filesystem.
        UEFI firmware needs an EFI partition, somewhere. I'd have thought that UEFI would now be considered standard. You could have the EFI partition on one drive, and a partition-less btrfs only install on another, but to me that doesn't sound "standard".
        No swap partition is needed because Btrfs does not use swap partitions, nor swap files.
        I don't understand what that's getting at; operating systems, like Kubuntu, use swap files or partitions, not file systems, like btrfs.

        Regards, John Little
        Regards, John Little

        Comment


          #5
          He is not using UEFI since it an XP dual boot. He is specifically referring to an old GRUB bug, discussed here:

          https://bugs.launchpad.net/ubuntu/+s...2/+bug/1059827

          I don't know if it's still relevant, but it was still an issue in 2014.

          Comment


            #6
            Originally posted by jlittle View Post
            I don't understand what that's getting at; operating systems, like Kubuntu, use swap files or partitions, not file systems, like btrfs.
            When you make Btrfs the root filesystem there is no need to install a swap partition because Btrfs doesn't use it, and it gives no option to create a swap file.
            Kubuntu isn't an operating system. It is a desktop environment. The operating system is the Linux kernel. Btrfs replaces EXT4 as a file system, and does so admirably.
            "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 GreyGeek View Post
              When you make Btrfs the root filesystem there is no need to install a swap partition because Btrfs doesn't use it, and it gives no option to create a swap file.
              Kubuntu isn't an operating system. It is a desktop environment. The operating system is the Linux kernel. Btrfs replaces EXT4 as a file system, and does so admirably.
              Let's clarify two things:

              1. The OP will most likely need swap space, due to the vintage of his machine. I doubt he has 16 gigs of RAM.

              2. Swap files can NOT reside on BTRFS partitions. They can reside on ext4 partitions

              3. The conclusion from 1 and 2 is that he will most likely need a swap partition.

              Comment


                #8
                Originally posted by mr_raider View Post
                Let's clarify two things:

                1. The OP will most likely need swap space, due to the vintage of his machine. I doubt he has 16 gigs of RAM.

                2. Swap files can NOT reside on BTRFS partitions. They can reside on ext4 partitions

                3. The conclusion from 1 and 2 is that he will most likely need a swap partition.

                An XP with a 1Tb drive. Is it recent enough to be 64bit? If it is a 32bit machine it is limited to 4GB of RAM, IF the OP has that much RAM. Using the 686-pae kernel to access more than 4GB of RAM is rewarded with poorer performance regardless of the distro, desktop or file system used.

                Btrfs runs fine on 4GB. I have 6GB. IF he has less than 4GB RAM I'd recommend not using Btrfs.

                Btrfs controls access to the disk that it is installed on and there is no provision in Btrfs to create and/or use a swap file. And, It will NOT see a swap partition if one is made. The Linux kernel will not use the swap partion even if it is activated because it communicates to the HD through Btrfs.
                It would be best if he gave the 500Gb to Btrfs and not split off a partition. Why? Because Btrfs subvolumes are more powerful and flexible than a partitiion. Oshunluver's post demonstrates that.

                He'll need to use the "Manual" partition option during the installation so that he does not inadvertantly wipe out his WinXP partition. He should assign that partition to "/" and select Btrfs as the filesystem. Btrfs and the installer will create a "root" which will contain @ and @home, the two default subvolumes. They are assigned to "/" and "/home" in the /etc/fstab file by the installer and the partition is identified by the UUID, not /dev/sdX. Creating an EXT4 partition just to "use" a swap partition is also a waste of disk space because the EXT4 partition won't be the root filesystem and can't control access to the swap partition.
                Last edited by GreyGeek; Dec 23, 2017, 12:10 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
                  No one is telling him to create an ext4 partition. He should probably create a linuxswap partition in accordance with these guidelines.

                  https://help.ubuntu.com/community/SwapFaq

                  The requirement for swap space is independant of btrfs. It depedns on his applications used. If he runs three virtual machines, he will need swap space.

                  Here is an example (my laptop):
                  Code:
                  [FONT=monospace][COLOR=#54FF54][B]mr_raider@HP-EliteBook-725-G3[/B][/COLOR]:[COLOR=#5454FF][B]~[/B][/COLOR]$ 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/sdb3 during installation
                  UUID=d55dc8c1-28f2-4aaf-94cb-717a4ba5a56b /               btrfs   defaults,ssd,subvol=@ 0       1
                  # /boot/efi was on /dev/sdb1 during installation
                  UUID=6866-C1DD  /boot/efi       vfat    umask=0077      0       1
                  # /home was on /dev/sdb3 during installation
                  UUID=d55dc8c1-28f2-4aaf-94cb-717a4ba5a56b /home           btrfs   defaults,ssd,subvol=@home 0       2
                  # swap was on /dev/sdb2 during installation
                  UUID=34e56584-a71c-4a03-b693-dddb9145674c none            swap    sw              0       0
                  
                  [/FONT]
                  Last edited by mr_raider; Dec 23, 2017, 12:14 PM.

                  Comment


                    #10
                    How are you going to turn it on?
                    From the swapon manual:
                    swapon may not work correctly when using a swap file with some versions of btrfs. This is due to btrfs being a copy-on-write filesystem: the
                    file location may not be static and corruption can result. Btrfs
                    actively disallows the use of swap files on its filesystems by refusing
                    to map the file.


                    One possible workaround is to map the swap file to a loopback device.
                    This will allow the filesystem to determine the mapping properly but may come with a performance impact.
                    ZRAM requires LOTS of memory. Using a loopback device can result in "holes" when mounted.

                    From the Btrfs FAQ
                    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. ....
                    A workaround, albeit with poor performance, is to mount a swap file via a loop device.
                    Finally, from personal experience: when I first installed Btrfs/Kubuntu on my laptop I created a swap partition equal to twice the size of my RAM. In over a year, running apps from PostgreSQL, GIMP, Stellarium, KMail, browsers, Qt SDK, games (Minecraft, ) 0A.D., etc...), even Orbiter_2010, a massive program, The swap partition was NEVER used. When I switched to Neon I didn't create a swap partition. In fact, without a swap partition, when Neon allowed me to install my seconday NVidia GT650M GPU as a primary my performance increased significantly.
                    "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


                      #11
                      OK lets further clarify some things ,,,,BTRFS , EXT4 and linux-swap ,are file systems that are put on partitions ...or in the case of BTRFS can use the unpartitioned disk as a hole .

                      the OP seams to want to keep his XP instalation .

                      Kubuntu IS an operating system ,,,,if you have a swap partition Kubuntu will use it even if Kubuntu is installed on a partition with a BTRFS file system .

                      I am in a Kubuntu-17.10 system ATM that is installed on a BTRFS file system along with Neon-LTS ,,,,thats rite 2 OS's on one file system .

                      Code:
                      vinny@vinny-Bonobo-Extreme:~$ swapon
                      NAME      TYPE      SIZE USED PRIO
                      /dev/sda2 partition   4G   0B   -1
                      the disks are as such

                      Code:
                      vinny@vinny-Bonobo-Extreme:~$ sudo parted -l
                      Model: ATA HGST HTS725050A7 (scsi)
                      Disk /dev/sda: 500GB
                      Sector size (logical/physical): 512B/4096B
                      Partition Table: msdos
                      Disk Flags: 
                      
                      Number  Start   End    Size    Type      File system     Flags
                      1      8225kB  323GB  323GB   primary   btrfs           boot
                      3      323GB   379GB  56.3GB  primary   ext4
                      4      379GB   496GB  117GB   extended
                      6      379GB   436GB  57.0GB  logical   ext4
                      5      436GB   496GB  59.8GB  logical   ext4
                      2      496GB   500GB  4295MB  primary   linux-swap(v1)
                      
                      Model: ATA HGST HTS721010A9 (scsi)
                      Disk /dev/sdb: 1000GB
                      Sector size (logical/physical): 512B/4096B
                      Partition Table: gpt
                      Disk Flags: 
                      
                      Number  Start   End     Size    File system  Name     Flags
                      1      1049kB  1000GB  1000GB  btrfs        primary
                      the Kubuntu-17.10 is in the /dev/sda1

                      the swap partition /dev/sda2

                      the SUBVOLUMES in the /dev/sda1/partition look as such

                      Code:
                      vinny@vinny-Bonobo-Extreme:~$ sudo btrfs sub list -at /mnt/sda1
                      ID      gen     top level       path
                      --      ---     ---------       ----
                      257     175687  5               @17.04
                      258     175687  5               @home17.04
                      267     175671  5               @
                      268     175672  5               @home
                      307     175670  5               @17.04_171204-202339
                      308     175670  5               @home17.04_171204-203017
                      309     175670  5               @home_171204-203128
                      310     175671  5               @_171204-203229
                      ya their named 17.04 ,,,and were ,,,,I am lazy and never renamed them after taking 17.04 to 17.10 with "do-release-upgrade" ,,,,,after taking a snapshot of the running system of coarse "@17.04_171204-202339" this is a newer on taken the 4th of this month .

                      with a snapshot I could restore the system to it's previous state just by deleting/renaming it's parent and renaming the snapshot to the original .

                      a swap FILE on a BTRFS file system IS a no no ,,,that is true

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

                      Comment


                        #12
                        I've always considered the Linux kernel the operating system and KDE a desktop (DE) which rides on top of it. It is the first loaded and the last to close down. Every other application communicates to the hardware through the kernel, which uses the libc6 library. The file system is just another application. The Linux kernel uses virtual memory or paging when it needs to give an application more memory space.

                        It's easy, when creating partitions, to create a swap partition and have fstab mount it. That doesn't mean that it will be used by the kernel or the DE or Btrfs. I've run some applications that stressed out memory, cpu and gpu usage, and drove the temp to within a degree of cpu max, and my swap partition was never used (when I had one while using Kubuntu + Btrfs). That's why I quit using a swap partition, and performance wise I have never missed it. The more RAM you have the less likely you'll ever use a swap partition, especially with the kernel being able to create paging on the file system.

                        Do some bench marks with the swap entry in fstab, then repeat them with that entry commented out. I'll wager you won't notice a difference.
                        "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


                          #13
                          Originally posted by GreyGeek View Post
                          Do some bench marks with the swap entry in fstab, then repeat them with that entry commented out. I'll wager you won't notice a difference.
                          If one wants to hibernate, as opposed to suspend, swap as large as the RAM is needed. I don't know anyone who hibernates their system, but I can imagine use cases.

                          Editing files that are larger than the RAM might use swap, too. Some video editing reportedly needs that. I certainly exceeded 4 GiB on occasion (vim undo trees) when that was my RAM, but I've never come close to my present 16 GiB.

                          Regards, John Little
                          Regards, John Little

                          Comment


                            #14
                            Ya, I don't know of anyone who uses hibernate either. I don't. Neon boots so fast that, IMO, there is no advantage to hibernation.
                            "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


                              #15
                              This is the clearest explanation of the difference bewteen suspend and hibernate I've seen.

                              Linux Mint (and Ubuntu): Suspend vs Hibernate (meaning)
                              Windows no longer obstructs my view.
                              Using Kubuntu Linux since March 23, 2007.
                              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                              Comment

                              Working...
                              X