Announcement

Collapse
No announcement yet.

Guide to BTRFS install?

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

  • mr_raider
    replied
    Originally posted by mastablasta View Post
    Thanks for the advice.

    Does this mean that even ext4 with GRUB on sda is out of the question?

    i never tried booting off the second hard drive or explored if the option comes up in BIOS (though i think it should). sdb is an old WD green. i had once bought a similar one thinking it would replace a system drive on another PC and had problems booting from it or even on linux.

    my plan is actually to boot into linux then provide a "boot once" shortcut to windows (unfortunately i read that KDE removed this nice feature with version 5). minecraft and a couple of old games should work well in wine, while for the rest they can make a little effort and have some patience for reboot.
    Oshunluvr solution is the most practical solution given your situation. Stage 1 grub and the core image may or may not fit on the 32kb boundary. It depends on several factors, inlcuding your chosen filesystem and your exact partition scheme. You should understand that most PCs from teh Vista era onwards leave enough space at the start of the disk so it's not an issue. XP era PCs have this issue. Period.

    You either try oshunluvr solution, or you try to install grub on sda and see what happens.

    If you absolutely MUST have a grub on sda, you can create a separate primary boot partition formatted to ext2. This moves part of grub out of the MBR area. The last time I did this (back in 2014) it worked. None of us can test this for you since we do not have XP era installs. I tried it in a virtual machine, and no modern tool (parted or gparted) even allows me to create a sector 63 boundary.

    You have to try. If you break it, we will fix it. Don't worry.

    Make sure you have a :

    1. Linux Live USB (kubuntu)

    2. WInXP repair or install disc.

    Leave a comment:


  • oshunluvr
    replied
    Originally posted by mastablasta View Post
    Does this mean that even ext4 with GRUB on sda is out of the question?
    The use of a particular boot loader, in this case GRUB, and a particular file system, whether btrfs or ext4 or any other, are completely unrelated to each other as long as the boot loader supports the file system. Both btrfs and ext4 are in the list of 36 file systems that grub supports. GRUB, like any other bootloader, needs a place to install. The version of GRUB we use, often known as GRUB2, requires more space than the older version. Old installs of Windows often occupy this space, both with it's own bootloader and data. The answer to the above is, I believe, yes - as it stands right now you likely will not be able to install GRUB to SDA. I explained why briefly before and offered, not only a solution but a great solution, which allows GRUB to be installed without causing damage to your current setup - a win-win. If you do manage to do everything (shrinking and moving partitions, etc), install GRUB to SDA, and then decide to leave Windows only one this computer and remove Linux, you will have an unbootable machine requiring repair Does that seem like a better solution to you?.

    The question to be answered is, do you want Linux on this computer or not? If you do, you must begin to take steps to make that happen. We can pontificate all day about what may or may not work, but until you try something, you'll never know what will work or not.

    I offered a solution that seemed to me to be the safest for your current data and installation, shortest in setup time time, and provides what I understood as your mission: To install Linux on this machine while still preserving the current Windows installation and data. If I misunderstood your goals, please correct me. If not, I suggest you begin by securing a verified (via the checksums), bootable USB drive with the Linux operating system of choice on it. Then ascertain as to whether or not you can boot to SDB with a simple BIOS change. Then begin with the partitioning steps as I outlined and continue as I described.

    Will you have to learn a couple new things and try things you haven't tried before? Yes, most definitely. Will each and every step along the way work as smooth as butter and as advertised? No way to tell. Will you have questions? Highly likely. Will you run into problems? Maybe. That's why you logged in here in the first place. isn't it?

    Good luck with whatever decision you make.

    Leave a comment:


  • mastablasta
    replied
    Thanks for the advice.

    Originally posted by oshunluvr View Post
    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.
    Does this mean that even ext4 with GRUB on sda is out of the question?

    i never tried booting off the second hard drive or explored if the option comes up in BIOS (though i think it should). sdb is an old WD green. i had once bought a similar one thinking it would replace a system drive on another PC and had problems booting from it or even on linux.

    my plan is actually to boot into linux then provide a "boot once" shortcut to windows (unfortunately i read that KDE removed this nice feature with version 5). minecraft and a couple of old games should work well in wine, while for the rest they can make a little effort and have some patience for reboot.

    Leave a comment:


  • oshunluvr
    replied
    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.

    Leave a comment:


  • mr_raider
    replied
    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.

    Leave a comment:


  • oshunluvr
    replied
    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.

    Leave a comment:


  • mastablasta
    replied
    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.

    Leave a comment:


  • GreyGeek
    replied
    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

    Leave a comment:


  • mastablasta
    replied
    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.

    Leave a comment:


  • GreyGeek
    replied
    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.

    Leave a comment:


  • oshunluvr
    replied
    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.

    Leave a comment:


  • oshunluvr
    replied
    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.

    Leave a comment:


  • mr_raider
    replied
    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.

    Leave a comment:


  • jlittle
    replied
    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

    Leave a comment:


  • oshunluvr
    replied
    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.

    Leave a comment:

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X