Announcement

Collapse
No announcement yet.

Guide to BTRFS install?

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

    #16
    A few years ago a person on whose computer I had installed Kubuntu called to say her computer wouldn’t boot into the desktop anymore. “I suspended it” she replied, “and then put it away in the carrying bag”.
    The battery had run out of power while her PC was in suspend. I had to re-install.
    I haven’t recently checked - is suspend even an available option any more?


    Sent from my iPhone using Tapatalk
    "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


      #17
      Originally posted by GreyGeek;408244)
      - is suspend even an available option any more?
      Of course, laptop users expect to be able to close the lid at any time.

      I love it on my desktop because it avoids the firmware start up time, about three times the grub + OS + GUI login time.

      Regards, John Little
      Regards, John Little

      Comment


        #18
        Late to this party so I haven't read every reply, but I wanted to address the OP:

        Originally posted by mastablasta View Post
        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.
        I've never seen a guide specific to btrfs or ext4 for that matter, so no comment.

        1. s there a good one for desktop PC not server?
        Not any difference in the install process - as far as file system format goes - between server and desktop. AFAIK, those differences are due to different software packages, not file systems.

        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..
        No, btrfs does not need empty space at the beginning of the drive - or anywhere else. However, GRUB or EFI will need some free space. Modern drive partitioning tools usually start at sector 2048 anyway, so this usually isn't an issue. As I noticed GreyGeek may have mentioned, I wrote a lengthy post about preparing for GRUB when using GPT partitioning, however that has nothing to due with the overlying file system, whether it be btrfs or any other.

        3. Does BTRFS with it's different naming of partitions interfere with any standard skripts?
        Maybe a bit of confusion here? BTRFS doesn't do any "naming of partitions". The Linux kernel handles device names (which includes partition naming schemes). Maybe you are referencing the use of subvolume names? If so, there's no "different" naming being used since only BTRFS uses subvolumes. The default subvolume names used by *Ubuntu distros ( "@" and "@home" ) are not a function of BTRFS, but rather of the installer software. A subvolume name can be any legitimate Linux name just like any directory or file. Subvolume names can be used (and typically are) on a mount command as a mount option to allow a subvolume to be mounted as though it were a device (drive or partition). Once mounted, a subvolume behaves as any other Linux mount and therefore would not effect any scripts. One possible situation might be a script designed to act on a partition using it's device name (/dev/sda1, etc.) might run into problems if the target were actually a subvolume within the btrfs file system on that device. In that case, the script would have to be re-written, which is a good idea anyway because it's poor practice to distribute a script that fails in a non-unusual installation. BTRFS is a default file system for a couple distros already any will grow as BTRFS becomes more accepted.

        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.
        There's no need for another drive in order to use BTRFS (or EXT4 or any other file system) in your free space. Any issues you might have regarding installation of a Linux distro to this drive would relate to dual-booting Linux and Windows regardless of file system choice.
        Last edited by oshunluvr; Jan 04, 2018, 10:35 AM. Reason: added link reference

        Please Read Me

        Comment


          #19
          Now that I've addressed the original questions, my advice;

          BEFORE attempting installation:
          • Read up on and prepare for dual-booting your particular Windows version with Linux.
          • Have a bootable USB drive on hand for emergencies (GpartedLIVE is a good choice).
          • Make a backup of your partition table and drive boot sectors (takes a few seconds with dd and can be a life saver in the event of a catastrophe like a power outage during installation).
          • Partition the free space and make a swap partition and a partition to install to. If you want to reserve some space for later use, do so now. However, remember btrfs - through it use of subvolumes - will allow your home and install to reside on the same partition. They will still have their own separate space, but will be on the same partition. Later - if you want to get fancy - you can install other OSs or versions of Kubuntu to the same btrfs partition as well.
          • Be 100% certain of what each partition contains. I.e. if Windows is a factory install, it likely has 2 or 3 partitions in use - like a restore partition and a boot partition. Know all the partition numbers and positions (beginning and end sectors) and what they contain before continuing - just in case.


          DURING installation;
          • Select "Manual" when the "Installation Type" (aka Disk Setup) window appears during install and select the empty partition as your install target and choose btrfs as the type.
          • Check and re-check the partitions that you are selecting for each purpose.
          • A pre-created SWAP partition should be detected and used by Ubiquity and most other installers. Creating it beforehand saves a step later and prevents the creation of a swap file which you generally do not want when using btrfs. Verify the pre-selection has happened before committing to the install.


          AFTER installation:
          • Once you have it booting to both Windows and Kubuntu, boot to Kubuntu and learn how to and take your first snapshot of your running install. Do this before anything else.
          • Enjoy Kubuntu.

          Please Read Me

          Comment


            #20
            I've been following oshunluvr's guides and found them great.

            There's one concept I was very slow to understand fully for which I have the conceit to think it might help others to explain:

            The root of a btrfs file system is called /.This is usually not the / of a running installation on that fs. A standard Kubuntu install is to subvolumes called @ and @home. These are in / of the btrfs fs. @ is mounted as / for the running Linux (in a standard install).

            So how do you get to the fs root? (Going to / and cd .. doesn't work.) With btrfs different subvolumes of the same fs are typically mounted separately in various places in the Linux tree, and the root subvolume can be mounted where you like, typically in /mnt, but a standard install doesn't mount it. oshunluvr suggests adding a /etc/fstab entry to do so, and I do that. I imagine that some programs or scripts might be confused by the loop in the "tree", which is no longer a "directed acyclic graph".

            Normally snapshots are created somewhere in the normal tree. But on my system do-release-upgrade put one in the btrfs /, making it hard to find till I mounted that / as above.

            Regards, John Little
            Regards, John Little

            Comment


              #21
              Originally posted by oshunluvr View Post
              Now that I've addressed the original questions, my advice;

              BEFORE attempting installation:
              • Read up on and prepare for dual-booting your particular Windows version with Linux.
              • Have a bootable USB drive on hand for emergencies (GpartedLIVE is a good choice).
              • Make a backup of your partition table and drive boot sectors (takes a few seconds with dd and can be a life saver in the event of a catastrophe like a power outage during installation).
              • Partition the free space and make a swap partition and a partition to install to. If you want to reserve some space for later use, do so now. However, remember btrfs - through it use of subvolumes - will allow your home and install to reside on the same partition. They will still have their own separate space, but will be on the same partition. Later - if you want to get fancy - you can install other OSs or versions of Kubuntu to the same btrfs partition as well.
              • Be 100% certain of what each partition contains. I.e. if Windows is a factory install, it likely has 2 or 3 partitions in use - like a restore partition and a boot partition. Know all the partition numbers and positions (beginning and end sectors) and what they contain before continuing - just in case.


              DURING installation;
              • Select "Manual" when the "Installation Type" (aka Disk Setup) window appears during install and select the empty partition as your install target and choose btrfs as the type.
              • Check and re-check the partitions that you are selecting for each purpose.
              • A pre-created SWAP partition should be detected and used by Ubiquity and most other installers. Creating it beforehand saves a step later and prevents the creation of a swap file which you generally do not want when using btrfs. Verify the pre-selection has happened before committing to the install.


              AFTER installation:
              • Once you have it booting to both Windows and Kubuntu, boot to Kubuntu and learn how to and take your first snapshot of your running install. Do this before anything else.
              • Enjoy Kubuntu.
              A concise guide and accurate. As state earlier, due the age of his system, he might have his first partition aligned to sector 63.

              We need to see the parted output to see that.

              Comment


                #22
                Originally posted by mr_raider View Post
                A concise guide and accurate. As state earlier, due the age of his system, he might have his first partition aligned to sector 63.

                We need to see the parted output to see that.
                Yes, and great point.

                I went through the pain earlier this year to convert all my drives to GPT and create the appropriate space for GRUB. I wrote a how-to, but it really wasn't that difficult. If your first partition already starts at sector 2048, you're already 80% done.
                Last edited by oshunluvr; Dec 26, 2017, 09:57 AM.

                Please Read Me

                Comment


                  #23
                  Originally posted by jlittle View Post
                  I've been following oshunluvr's guides and found them great.

                  There's one concept I was very slow to understand fully for which I have the conceit to think it might help others to explain:

                  The root of a btrfs file system is called /.This is usually not the / of a running installation on that fs. A standard Kubuntu install is to subvolumes called @ and @home. These are in / of the btrfs fs. @ is mounted as / for the running Linux (in a standard install).

                  So how do you get to the fs root? (Going to / and cd .. doesn't work.) With btrfs different subvolumes of the same fs are typically mounted separately in various places in the Linux tree, and the root subvolume can be mounted where you like, typically in /mnt, but a standard install doesn't mount it. oshunluvr suggests adding a /etc/fstab entry to do so, and I do that. I imagine that some programs or scripts might be confused by the loop in the "tree", which is no longer a "directed acyclic graph".

                  Normally snapshots are created somewhere in the normal tree. But on my system do-release-upgrade put one in the btrfs /, making it hard to find till I mounted that / as above.

                  Regards, John Little
                  Nice post. Yes, it does take a realignment of one's thought processes to begin to understand btrfs vs. "conventional" file systems. This is one of the reasons I've become a stickler over the last couple of years about specifically referring to file systems and partitions as separate things. They always have been separate, but in use with older file systems like the EXT family, there's no practical difference at the user level and there was nothing confusing about stating /dev/sda1 when you really meant the file system residing on /dev/sda1.

                  When using BTRFS, partitions are devices like hard drives or any other piece of hardware and the file system is entirely different. One excellent example is BTRFS file systems can span multiple devices, which can include an array of various sizes and drives. It is no longer practical to refer to /dev/sda1 as the location of your files because, although you may have mounted /dev/sda1, your file system may also may reside on /dev/sdb1 and /dev/sdc (partition number intentionally omitted) as well. When you add in, like you pointed out, that you can mount separate parts of a BTRFS file system like the "@" and "@home" subvolume defaults of the Ubuntu family installations, understanding BTRFS can be a little overwhelming at first. By referring to partitions solely as divisions of drive space and not where files are stored, we can begin to grasp the concept of the file system as a location and not just a format.
                  Last edited by oshunluvr; Jan 04, 2018, 08:36 AM.

                  Please Read Me

                  Comment


                    #24
                    Originally posted by jlittle View Post
                    Of course, laptop users expect to be able to close the lid at any time.

                    I love it on my desktop because it avoids the firmware start up time, about three times the grub + OS + GUI login time.

                    Regards, John Little
                    True, but past releases didn’t allow it (on my installs) and for my personal taste I set low power and lid closing to power down instead of hibernate or suspend


                    Sent from my iPhone using Tapatalk
                    Last edited by GreyGeek; Jan 03, 2018, 11:40 AM.
                    "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


                      #25
                      apparently when school has holidays it is ok to play games on PC and watch youtube videos. i was brushed aside.

                      my USB install is ruined it seems as it can no longer load the plasma. but i got to use the virtual console.
                      This is the parted output:

                      Code:
                      Model: ATA ST1000DM003-1CH1 (scsi)
                      Disk /dev/sda: 1000GB
                      Sector size (logical/physical): 512B/4096B
                      Partition Table: msdos
                      Disk Flags: 
                      
                      Number  Start   End     Size    Type      File system  Flags
                      1      32,3kB  64,5GB  64,5GB  primary   ntfs         boot    [COLOR="#FF0000"]<<<--- Windows XP OS partition[/COLOR]
                      2      64,5GB  464GB   399GB   extended               lba    [COLOR="#FF0000"]<<<--- Extended windows partition with: [/COLOR]
                      5      64,5GB  388GB   323GB   logical   ntfs                    [COLOR="#FF0000"]<<<--- games, portable apps, Firefox & TB install, some static data files and a little bit of music[/COLOR]
                      6      388GB   464GB   75,7GB  logical   ntfs                    [COLOR="#FF0000"]<<<--- virtualbox images[/COLOR]
                      
                      Model: ATA WDC WD10EARS-00Y (scsi)
                      Disk /dev/sdb: 1000GB
                      Sector size (logical/physical): 512B/512B
                      Partition Table: msdos
                      Disk Flags: 
                      
                      Number  Start   End     Size   Type      File system  Flags
                      1      1049kB  524GB   524GB  primary   ntfs         boot    [COLOR="#FF0000"] <<<--- Not sure why this one has boot flag. it's WD Green [I]pure[/I] data drive. pictures, videos...[/COLOR]
                      2      524GB   1000GB  476GB  extended                        [COLOR="#FF0000"] <<<--- Linux images, GOG files, some backup data form Linux PC[/COLOR]
                      5      524GB   1000GB  476GB  logical   ntfs
                      
                      Model: TOSHIBA TransMemory (scsi)        [COLOR="#0000FF"]<<<--- USB drive with linux[/COLOR]
                      Disk /dev/sdc: 15,5GB
                      Sector size (logical/physical): 512B/512B
                      Partition Table: msdos
                      Disk Flags: 
                      
                      Number  Start   End     Size    Type      File system     Flags
                      1      1049kB  12,5GB  12,5GB  primary   ext4            boot
                      2      12,5GB  15,5GB  2999MB  extended
                      5      12,5GB  15,5GB  2999MB  logical   linux-swap(v1)
                      /dev/sda should have about 500 or 450 GB left for OS install. it got cloned drive to drive with clonezilla at the last minute from previous old and failing drive and then the partitions on it were expanded a bit.

                      i think it might be better to go with ext on this one while at the same time spend some time reading up on btrfs. i plan to give this PC to the kids and get a new machine later on for me, when i save some money for it. this one will work until it works. it is not so bad and due to GPU upgrade can handle various 2007, 2008 and even some 2009 and later games. some on lower setting, some on high. the old games are cheap. plus it can also surf the web well and i can easilly run at least one linux desktop virtual machine on it. not much by today's standards but often more than i need. so it would be a shame to discard it.
                      Last edited by mastablasta; Jan 04, 2018, 02:23 AM.

                      Comment


                        #26
                        Do you Windows installed on both HDs? Are you trying to dual boot?

                        If not delete all the Partitions and create /dev/sda1 and /dev/sdb1 and install Kubuntu 16.04 LTS to sda1 using Btrfs as the file system. Then use sdb1 as either RAID1 or as RAID0 or as a Btrfs backup for snapshots
                        "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


                          #27
                          yes, dual boot is "a must". i've edited the post to explain what the currently occupied disk areas have on them.

                          /dev/sda has about 500 GB left at the end of it. it's a 1 TB drive where only about half is occupied and the rest is non-formatted disk space.

                          i have two option use that space for linux (dual boot setup) so i can boot to windows when they want to play games. or continue using windows XP and use Virtualbox for browsing and the rest of OS for games and office work. but support for various security products is ending or has ended, so there is a higher risk than it was a year ago.

                          Comment


                            #28
                            Originally posted by mastablasta View Post
                            /dev/sda has about 500 GB left at the end of it. it's a 1 TB drive where only about half is occupied and the rest is non-formatted disk space.
                            500GB is a lot of space to work with for linux, so why not just use it? Here's how I would do it:
                            First;
                            Create partition /dev/sda3 as SWAP equal to the amount of RAM in your system.
                            Create partition /dev/sda4 with the remaining amount of free space on the drive.
                            You should be able to create both of these partitions without touching anything else on the drive. Use the linux partition manager from a LiveUSB to do this.

                            Now I'm going to make some assumptions;
                            Your system boots to /dev/sda and that's where Windows is.
                            Your system bios allows you to boot to /dev/sdb if you choose to.

                            If these assumptions are both true;
                            Begin the Kubuntu (or whatever) installation from a new, verified LiveUSB.
                            When installing, select "Manual" during "Disk Setup" drive partitioning steps.
                            Select /dev/sda4 and click "Edit".
                            Under "Use as:" select "btrfs..." as the format, check the "Format..." box, and set the mount point as "/" and click "OK".
                            The SWAP partition will be automatically recognized and selected as swap,
                            You can verify SWAP setting by noting the "Edit" button now says "Change..." instead of "Edit" when you select /dev/sda3. This indicates it is already set as swap.
                            Toward the bottom, find "Boot loader" and next to "Device for boot loader installation:", select /dev/sdb. Do not choose /dev/sda or you will have to repair Windows.
                            Re-read the above line and verify you did this correctly. It is important.
                            then continue with the installation.

                            When installation is complete, boot into BIOS and set drive 2 or whatever your BIOS uses to refer to /dev/sdb as the default boot drive and save and boot.

                            You should now be looking at your Kubuntu install. What you do next depends on your preferences, but assuming you want Windows to be the default boot (for the kids) you will need to edit /etc/default/grub and change "GRUB_DEFAULT=0" to whatever Windows is in the boot list. You can either count the number of "menuentry" lines in /boot/grub/grub.cfg and use that number minus 1 (the count starts at 0 so the 5th item would be 4) or you can search for the menuentry that points to Windows and use the text entry along side it instead of a number. Using the text entry is safer in the long run because it won't change where the number sequence could. The menuentry will start with "menuentry "Windows 7" {..." or something similar. Use the quoted part in the menuentry in the GRUB_DEFAULT= like this: GRUB_DEFAULT="Windows 7".

                            Next you want to be sure the grub menu is displayed so you can boot to Kubuntu when you want. So in /etc/default/grub, look for these lines and make them look like this;
                            # GRUB_HIDDEN_TIMEOUT=3
                            # GRUB_HIDDEN_TIMEOUT_QUIET=false
                            GRUB_TIMEOUT=5
                            Then when you're all done with these edits, run "sudo update-grub" in a terminal. If all was done correctly, you'll have 5 seconds of grub menu to choose Kubuntu before Windows boots up.

                            The logic and reasons for all these steps;
                            By using the available free space on sda, no current partitions are in danger.
                            Since you already have an extended partition and it's full, you only have 2 primary partitions available on sda where the free space is.
                            One of these partitions should be SWAP for lots of reasons.
                            By using BTRFS, you only need a single partition for your install and home because the installer will automatically use separate subvolumes for you.
                            By using sdb as the boot drive, you do not endanger your ability to boot to Windows later if grub becomes damaged - just switch back to booting sda.
                            There's no room on sda for GRUB to install because the first partition starts at 32k. sdb should have the room for the boot loader without potentially dangerous partition moving.
                            By making Windows the default boot OS, the kids won't even notice the change.
                            Assuming all goes as planned, you will have a solid dual-boot platform for as long as you want. Windows won't even know Linux is there and Linux won;t mess with Windows unless you make it do so.
                            Last edited by oshunluvr; Jan 04, 2018, 09:25 AM.

                            Please Read Me

                            Comment


                              #29
                              By deafult in a dual boot setup grub should be visible. Try what oshunluvr says and see if it works. His solution has the advantage of bypassing the grub sector 63 bug. You should be aware that if it does work, you system needs both drives intact to boot properly. If you ever replace either one, you will have to perform some serious surgery.

                              Comment


                                #30
                                Originally posted by mr_raider View Post
                                By deafult in a dual boot setup grub should be visible. Try what oshunluvr says and see if it works. His solution has the advantage of bypassing the grub sector 63 bug. You should be aware that if it does work, you system needs both drives intact to boot properly. If you ever replace either one, you will have to perform some serious surgery.
                                Well, not surgery nor even serious. A single command from a LiveUSB will re-install grub to whatever device you want. Takes longer to boot the USB than to repair grub. Also, the grub repair would take eons less time than repairing the Windows boot manager if the installation went sideways, and sda isn't available for grub in it's current state. All other options are exponentially more work and potential dangerous to current data. I stand by my advice.

                                I couldn't remember if the default grub.cfg shows the menu or not when a secondary installation is detected, so I thought it better to include the instruction. I don't use grub in this basic way so my typical experience is different.
                                Last edited by oshunluvr; Jan 04, 2018, 11:55 AM.

                                Please Read Me

                                Comment

                                Working...
                                X