Timeshift & grub-btrfs.path

You can find good Information about Btrfs in the wiki

:footprints:

bcachefs is certainly better and faster than btrfs even though it is still marked experimental. In phoronix benchmark it was fastest of all filesystems in one test, and always faster than btrfs iirc.

AFAIK not a single case of irrecoverable filesystem damage has been documented, when btrfs seems to be quite fragile in this aspect, i read that even running out of space on root often leads to broken fs that often does not get fixed by fsck.

the one ā€œfeatureā€ btrfs fans seem to be missing in bcachefs is booting into snapshots. But this is supposedly a design decision, and same functionality can be done through bind mounts.

@varikonniemi As far as I remember, the Phoronix Bcachefs test overtook BTRFS only when working with some databases and the speed of launching applications, but in many respects was inferior. Bcachefs obviously fewer users and the lack of reports about problems may be due to this.
The problem is that this test was carried out for a long time, as soon as this file system was added to the kernel from that moment on there were many changes and the situation could improve, but I did not find new tests. Also, if you read the appropriate section on Reddit and the repository on GitHub, you will notice that people can have problems with it.
There are still a number of shortcomings: there is no GRUB support, there is no Scrub, there are no convenient graphic tools, there is no way to boot into the system snapshot, and some more things. Perhaps this will be a good file system in a few years, but now it is doubtful.

1 Like

Do you have more informations about it?

Where it fails and what makes Rsync different?

Because i had no problem in the past with duplicated my home folder from PC to Laptop as my Laptop was new and i could just copy+overwrite the full home partition with the Timeshift Rsync that i created on my external drive.

Since then i thought that Timeshift Rsync is still a good backup solution, even when i see the own Developer from Timeshift was talking against it.

I just know today after the second Topic that i posted above, that BTRFS and Rsync snapshots are the big difference and i think the developer just didnā€™t draw the clear line between this both snapshot features.

try to use the test where bcachefs was not in debug mode https://www.phoronix.com/review/bcachefs-benchmarks-linux67

Only DIO was bad performance. It was a bug that has since been fixed. Other than that, bcachefs performed well, and even won some tests.

Interesting to see what the numbers would be today as it has matured significantly since kernel 6.7 that was benchmarked.

I saw these tests too ,but they were made shortly after the first one and do not include subsequent corrections.
For me the result did not change in some areas better, in some not, need to understand that some of the tests, for example working with databases, are not very important for home use, and bcachefs loses the I/O tests.
New tests are needed that would take into account the many fixes in btrfs and bcachefs.

Ok, iv been studying btrfs for a couple of days now, but i have a couple of questions that i really need a person who knows what they are doing to give an opinion on (GPT 4o is great and all but often misguided, lol).

If I have 2 devices, one has a btrfs partition and OS installed, the other has ext4 and also has an OS installed (the same OS actually, Manjaro KDE). What I want is to move the btrfs OS to the other device and have it also be btrfs. So basically to move my btrfs OS to a new btrfs device. I have thought that I might do the following:

  • Wipe the ext4 partition,
  • Add this empty device to the btrfs volume so they become a single volume and hopefully it should also have been turned into btrfs automatically at this point.
  • Wait for it to balance.
  • Then remove the old device from the volume so just the new device holds the OS.

I should then be able to wipe/remove the first device as it is no longer part of the volume. The volume now resides on a new btrfs device.

Now I might see some problems. Would the fstab in this OS be pointing at incorrect UUIDs, would the bootloader work? Would GRUB need changing?

Is this a good or bad way to move this OS from one device to another like this?

Net v quick question:

  • Can Rescuezilla can backup & restore Btrfs partitions? (just curious).

Well, I donā€™t quite understand the problem, should the first disk remain or will it be deleted later? Iā€™ve honestly never done this before, but btrfs-replace might be something you need to look into.
If this doesnā€™t work for you, then it might be worth creating a new thread for this specific question or asking in the appropriate reddit section. Of course, you can probably completely clone an entire disk partition with any suitable utility (dont know about Rescuezilla) .
If you completely change the drive, you will still need to update fstab and grub, since the links will be incorrect.
upd: I found information about the btrfs-clone tool, but I canā€™t say anything about its reliability.
Perhaps this answer will also help you.

well basically i want to move a btrfs file system and the os on it to another disk and then boot to that disk.

Im following the ideas from here but just wanted a second opinion that im not completely misunderstanding anything to badly.

That is a way to send over a whole filesystem, snapshots and all, but it would be a very slow process. btrfs balance can be a slow process to create the mirror, especially when there are HDD(s) involved. This also adds the requirement of having exactly the the same partition size on both ends.

Since you are using Timeshift/brtfs, I would just create a snapshot and use that one when youā€™re ready. Then just send a single snapshot over.

Iā€™ve only ever used Clonezilla, but that was a long time ago and only for Windows machines. I wouldnā€™t dream of it for any of the common Linux filesystems.

If you went the send a single snapshot route, with btrfs you do have some cool options as well. But I do all the steps on the command line, which really only is a few commands. Without more information I canā€™t give you them. lsblk -f would be the most useful to start, and saying which is what.

The UUIDs will all remain the same if you send a snapshot. Then a simple chrootā€™d sudo update-grub, but I do not know your layout, and your BIOS boot drive (or are you just pointing that to the new one?).

This topic has veered so much from the original post, I want to keep it brief.

I can think of examples that rsync would fail, that would not affect you. (Most are for enterprise systems, or low level tinkerers like I used to be.)

But Timeshift is cool the way it stores your data, and makes symlinks to files it already has. Using it with ext4, I can even get behind. If you donā€™t want to bother with other options, as this works for you, also great.

The efficiency, and even reliability, of it drives me mad. When you have btrfs, you lose all of itā€™s great benefits of it going this route.

1 Like

Using a reliable cloning tool such as CloneZilla will do this, irrespective of whatever partitions or filesystems exist on the disk; a byte-for-bye clone, either disk-to-disk or using a cloned image as an intermediary.

So many options !! , I hear you but i had thought of just doing the obvious method of sending a snapshot but the problem is the target system is running on ext4 and so i could not just ā€œuseā€ or restore the snapshot. I would have to format the partition to be btrfs first and then maybe see what i can do so swings and roundabouts. The method im looking at has been mentioned a couple of times actually, i found a link to a very similar post in one of your links.

Cool, this is handy to know, not that id be using clonezilla any more if i moved to btrfs but i might like take an image while im still in the early days.

In the end the problem here is choice^ , there are just so many options when you start to look at zfs and btrfs systems, and thatā€™s a good thing, kinda :stuck_out_tongue: (as long as you do understand exactly what you are doing!)

Many of those actually using BTRFS probably donā€™t have that prerequisite; possibly only having tried it because some BTRFS Fan Boy/Girl made it sound really kool. :joy_cat:

I might try it myself - one day - until then EXT4 serves me well enough.

lol yea maybe, in may case i have been tinkering with ZFS on my truenas for a year or so and Iā€™m also extremely lazy, so the snapshots over time in the way these file systems do is just great (right up until the point where you bork you whole system and network (somehow, who knows)). I might be lazy but i also get bored and just start looking at things for no more reason than ā€œhmmā€¦I wonderā€¦ā€

Yes in that blog they just miss out the making the partition and filesystem.

And I said, btrfs balance which is technically wrong, but that is essentially what happens in the background, when you remove the old device. As you read, he says:

Removing the old device takes a lot longer but the command is just as simple:

My words were along the same line. :wink: But yes you still have to make a btrfs filesystem, e.g. sudo mkfs.btrfs /dev/..., you can do right over top of the ext4 one.

Or a lot of people use the parted GUI to do both at once, but I think you would have to delete and remake the partition that way.

That is fairly easy step wise, and you get all your snapshots you currently have.

Just to give you an idea, the way I send a single snapshot over is just something like this

The new btrfs FS gets mounted somewhere, with subvol=@ , and it takes just:
btrfs send timeshift-btrfs/snapshots/2024-06-07_00-00-00/@ | btrfs receive /mnt

Either works. The above happens really quick, the other way brings everything.

I was just watching a video and now im scratching my head again. He says that he just edits fstab to point his / to any snapshot and then reboots but surly that cant work. Firstly in his fstab he has

IUUID=ceBSZled 842-4dcf-8dfd-7ch34855353F / btrfs rw, relatime, ssd, space_cache, subvolid=288, subvol=@ 0 0

But surly you cant just change the subvolid but leave the subvol pointing to a different subvol?

More importantly, you cant use the snapshots like that because the snapshots are read only (from what iv read) not rw so god only know what would happen if you tried to boot from it like that?

this vid at timestamp

This is kind of what Timeshift (btrfs) restore does. And specifying the subvolid, or the subvol (name), do the same thing in this case. With Timeshift, itā€™s a little cleaner, and /etc/fstab (and /boot/grub/grub.cfg) remain unchanged.

When you Timeshift restore, I believe, you can think of it as essentially just renaming the subvolumes.

I actually used the restore last week, hereā€™s what it looked like after:

sudo btrfs sub list /                                                                                             ī‚² āœ”
ID 256 gen 708845 top level 5 path timeshift-btrfs/snapshots/2024-05-29_15-03-50/@
ID 257 gen 703221 top level 5 path timeshift-btrfs/snapshots/2024-05-29_15-03-50/@home

 ...
 ... 

ID 710 gen 703218 top level 5 path timeshift-btrfs/snapshots/2024-05-28_12-46-50/@
ID 711 gen 703217 top level 5 path timeshift-btrfs/snapshots/2024-05-28_12-46-50/@home
ID 714 gen 709006 top level 5 path @home
ID 715 gen 709005 top level 5 path @
ID 716 gen 708845 top level 5 path timeshift-btrfs/snapshots/2024-05-31_00-11-45/@
ID 717 gen 704395 top level 5 path timeshift-btrfs/snapshots/2024-05-31_00-11-45/@home

The first snapshot pair, used to be the regular subvol names: @ and @home. It also gets the Timeshift comment: Before restoring '2024-05-29_12-46-50' (so you can always go back). But those subvol names are now on ID 714 & 715.

<rant>
In that video, thereā€™s a lot of terminology, and things he gets wrong in that video. Some are minor like calling it deduplication, thatā€™s something else entirely. Itā€™s copy on write (CoW), which is also why everything seems almost instant for these commands. He also goes on to say things like, ā€œI donā€™t trust itā€™s (btrfsā€™s) striping capabilityā€. Itā€™s been stable for many years! But I could go on about a lot misinformation here.

Also, In his snapshot restore example, he used @home. But for @, there are more steps.
</rant>

Timeshiftā€™s default is read/write snapshots, and many people do not prefer this. The package extra/grub-btrfs is not part of Timeshift. But it detects snapshots, and letā€™s you boot them. This is a part that can possibly create a mess, especially if you continue booting into these snapshots moving forward. (It will appear to work, and Iā€™ve used it for emergenciesā€¦ With care!).

But itā€™s easy to set them as read only though with just:

sudo btrfs prop set /mnt/timeshift-btrfs/snapshots/<SNAPSHOT>/@ ro true
sudo btrfs prop set /mnt/timeshift-btrfs/snapshots/<SNAPSHOT>/@home ro true

Is this all another tangent from moving your volumes to another drive? Because this doesnā€™t exactly help you move anything across filesystems.

2 Likes

btrfs-asistant also needs snapper and snap-pac.

I actually just found out that the timeshift snapshots are not created read-only. So it looks to me like timeshift specifically does not set them as read-only, the oppersit to what the Btrfs wikis and manuals say. Okay, thatā€™s fine, now I know.

sudo btrfs subvolume list -r / is empty, so they are all rw.

Yea its another completely off tangent question :P. I have already marked this thread as solved, itā€™ll be closed in a few days and i just hate opening new posts for every little stupid question of mine, but yea i know i should really.

I do appreciate the help though :slight_smile:

It is really easy:

  • Create a new rw-Snapshot from an ro-snaposhot you selected
  • Then boot into this one
    :footprints: