Btrfs for save changes file
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Btrfs for save changes file
Post#1 by istinnjazz » 26 Jun 2016, 22:50
istinnjazz
Re: Btrfs for save changes file
Post#2 by fullmoonremix » 26 Jun 2016, 22:57
I moved on after the file system locked on me.
I'm sure it works... it just appears to require certain pre-conditions.
I will research this tonight and report my findings tomorrow.
Unless someone else elaborates.
fullmoonremix
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#3 by istinnjazz » 26 Jun 2016, 23:41
commands used:
Code: Select all
dd if=/dev/zero of=save-bt2.dat bs=1M count=128
mkfs.btrfs save-bt2.dat
edit: nope, tested with 64k also
istinnjazz
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#4 by istinnjazz » 27 Jun 2016, 00:12
Code: Select all
root /home/guest # modinfo btrfs
filename: /lib/modules/4.5.5-xanmod8-porteus/kernel/fs/btrfs/btrfs.ko
license: GPL
alias: devname:btrfs-control
alias: char-major-10-234
alias: fs-btrfs
depends: raid6_pq,xor,zlib_deflate
intree: Y
vermagic: 4.5.5-xanmod8-porteus SMP preempt mod_unload
istinnjazz
- francois
- Contributor
- Posts: 6514
- Joined: 28 Dec 2010, 14:25
- Distribution: xfce plank porteus nemesis
- Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.
Re: Btrfs for save changes file
Post#5 by francois » 27 Jun 2016, 01:41
http://www.yodaconditions.com/dokuwiki/ ... tall.btrfs
francois
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Btrfs for save changes file
Post#6 by brokenman » 27 Jun 2016, 02:19
modprobe btrfs
In your case you may need to compile btrfs into the kernel or unpack initrd.xz and add the modprobe command into linuxrc
Wear your underpants on the outside and put on a cape.
brokenman
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#7 by istinnjazz » 27 Jun 2016, 12:20
to create the new initrd i have used:
Code: Select all
find . | cpio --create --format='newc' > /mnt/sdb5/linux/tmp/newinit-btrfs
I do not know if it really can find and load the module from the core xzm, initrd is working and booting but module can not be loaded again.
I will have to recompile, and use a new vmlinuz to be sure. But it would be good to know a way that works for modules in initrd level.
istinnjazz
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Btrfs for save changes file
Post#8 by Bogomips » 27 Jun 2016, 14:00
If you can bear with me will provide you all the steps of what I know should work. 8)
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#9 by istinnjazz » 27 Jun 2016, 14:42
there is no hurry, take your time

Keep in mind that I use nemesis 3.5, the arch based porteus
istinnjazz
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Btrfs for save changes file
Post#10 by Bogomips » 27 Jun 2016, 23:32
No worries. Will do example without being confined to single distro.istinnjazz wrote:Keep in mind that I use nemesis 3.5, the arch based porteus

- Get kriss's script enhanced from http://forum.porteus.org/viewtopic.php? ... =15#p41205
- Name it punpin.sh
Code: Select all
mkdir ird cp /Path/to/initrd.xz ird sh ../punpin.sh
- Edit linuxrc:
Code: Select all
#====================================== # ENTRY (Put this right at the start!) #-------------------------------------- . modprobe btrfs # 2016-07-27 ## Let's start! mount -nt devtmpfs none /dev
- Looks like there is already a kernel module: /lib/modules/`uname -r`/kernel/fs/btrfs/btrfs.ko available.
- Add the module. (For this exercise we'll use: /lib/modules/4.1.15/kernel/fs/btrfs/btrfs.ko)
Code: Select all
cd /home/guest cp --parents /lib/modules/4.1.15/kernel/fs/btrfs/btrfs.ko ird
- Do Dependency
Code: Select all
mkdir -p dep/lib/modules/4.1.15 cp -a /lib/modules/4.1.15/kernel dep/lib/modules/4.1.15 /sbin/depmod -b dep 4.1.15
- Should now have something like:
Code: Select all
guest@porteus:~$ ls dep/lib/modules/4.1.15/ kernel/ modules.alias.bin modules.dep modules.devname modules.symbols modules.alias modules.builtin.bin modules.dep.bin modules.softdep modules.symbols.bin
Code: Select all
cp -p dep/lib/modules/4.1.15/* ird/lib/modules/4.1.15
- Pack Initrd:
Code: Select all
cd ird sh ../punpin.sh xz cd .. # Assuming same directory as for initrd.xz cp -p newinitrd.xz /Path/to/newinitrd.xz
- Testing. At the boot screen hit tab key, in order to edit entry. Replace initrd.xz with newinitrd.xz
- Good Luck!
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#11 by istinnjazz » 28 Jun 2016, 10:16
It is good to have same good instructions to deal with initd, I have never touched it and it seems very selective on the way it has to be packed.
To sum up some of my findings, if correct
1. If we will change/upgrade kernel, modules directory inside initrd becomes obsolete and/or possibly incompatible
2. It seems that the save.dat file is being read before anything else in the union sequence. And I guess is impossible if not designed as such, to have a special xzm with those modules so initrd can access them before loading save.dat outside of the initrd itself. But this seems specific and rare, so not much of a deal here.
3. It seems a good method in cases where exotic/old drivers or special fs has to be recognized upon boot. I have already a kernel panic on an old machine upon boot and I suspect there is a chip/set driver as a module behind this (some other distros boot ok).
Anyway, I think it is better (for this particular case) to recompile kernel with core btrfs in my next upgrade and keep initrd intact.
Thanks for your method.
P.S. I will test Btrfs, it seems there is future in this and it seems relatively stable on latest versions. I have read good opinions about it compared to ext4 especially for failure recovery. I want to test its behavior in savefile mode, https://wiki.archlinux.org/index.php/Btrfs.
istinnjazz
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Btrfs for save changes file
Post#12 by Bogomips » 28 Jun 2016, 11:12
A quick glance at an annotated linuxrc, seems to confirm that changes are processed before modules dealt with.istinnjazz wrote:2. It seems that the save.dat file is being read before anything else in the union sequence.
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- istinnjazz
- Samurai
- Posts: 115
- Joined: 15 May 2016, 14:10
- Distribution: Manjaro-OpenRC/Nemesis
Re: Btrfs for save changes file
Post#13 by istinnjazz » 03 Jul 2016, 21:14
Code: Select all
root /home/guest # dmesg | grep BTRFS
[ 5.853178] BTRFS: device fsid 78050861-e19d-49fa-974a-8cd8af3aeeb5 devid 1 transid 18 /dev/loop0
[ 5.857306] BTRFS info (device loop0): disk space caching is enabled
[ 5.857308] BTRFS: has skinny extents
Code: Select all
root /home/guest # dmesg | grep F2FS
[ 5.849154] F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 5.849157] F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
[ 5.849200] F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 5.849202] F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock
[ 5.849206] F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 5.849208] F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock
[ 5.849210] F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[ 5.849211] F2FS-fs (loop0): Can't find valid F2FS filesystem in 2th superblock
root /home/guest #
istinnjazz