Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 339472 - sys-fs/nilfs-utils: need init.d helper for rootfs on nilfs2
Summary: sys-fs/nilfs-utils: need init.d helper for rootfs on nilfs2
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Naohiro Aota
Depends on:
Reported: 2010-10-02 13:52 UTC by Denis Kaganovich
Modified: 2023-04-01 21:21 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---

sys-fs/nilfs-utils althernative (nilfs2_root.patch,923 bytes, patch)
2010-10-02 14:50 UTC, Denis Kaganovich
Details | Diff
sys-fs/nilfs-utils althernative (nilfs2_root_ac.patch,1.14 KB, patch)
2010-10-02 15:50 UTC, Denis Kaganovich
Details | Diff
0001-Start-garbage-collector-for-nilfs2-as-root-fs.patch (0001-Start-garbage-collector-for-nilfs2-as-root-fs.patch,1.69 KB, text/plain)
2013-05-11 17:19 UTC, Peter Volkov (RETIRED)

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Kaganovich 2010-10-02 13:52:06 UTC
According to nilfs2 mount behaviour, IMHO good idea to change in "root" init script:
mount -n -o remount,rw /
mount -n -o remount,rw / && mount -f -o remount /

mount.nilfs2 not start garbage collector daemon in "-n" and recommend (man mount.nilfs2) to do "-f" after it. Also IMHO it must be compatibe with any other fs.

If no, sys-fs/nilfs-utils must install own init script (also remind to bump/clone v2.0.20 of nilfs-utils).

PS I not use baselayout-2, but FYI for it too.

Reproducible: Always
Comment 1 Denis Kaganovich 2010-10-02 14:50:57 UTC
Created attachment 249326 [details, diff]
sys-fs/nilfs-utils althernative
Comment 2 Denis Kaganovich 2010-10-02 15:50:03 UTC
Created attachment 249338 [details, diff]
 sys-fs/nilfs-utils althernative 

This variant check for "fsck_on_battery" option in /etc/conf.d/fsck & AC power state before forcing nilfs2_cleanerd.
Comment 3 Denis Kaganovich 2010-10-02 17:05:00 UTC
According to last patch/ideas, I want to readdress this bug to "ebuilds" - sys-fs/nilfs-utils only and do not fix /etc/init.d/root.
Comment 4 SpanKY gentoo-dev 2010-10-02 17:41:01 UTC
yes, we're not going to special case any rootfs type in baselayout
Comment 5 Alexander Bezrukov 2012-05-21 23:18:12 UTC
(In reply to comment #4)
> yes, we're not going to special case any rootfs type in baselayout

I would like to note that while adding a special /etc/init.d script to nilfs-utils ebuild might be a right thing to do given the effort, doing mount -f -o remount / is NOT a special treating of an esoteric rootfs and should be done for ANY rootfs and (with appropriate changes) for ANY fs mounted prior to /etc/mtab is made writable. While this is really a minor issue, the wrong thing about /etc/init.d/mtab (which is used instead of mount -f in Gentoo) is that the info otherwise put by mount helpers to /etc/mtab is lost (assuming /etc/mtab is an ordinary file). In case of nilfs2 this is gcpid=, in case of nfs this is user=.
Comment 6 Peter Volkov (RETIRED) gentoo-dev 2013-04-26 16:15:12 UTC
@base-system, what do you think about comment #5?

In old baselayout we had something like:

 # Add the entry for / to mtab
 mount -f /

I guess this should fix this problem, but what do you think? Is it worth to add this hack into /etc/init.d/mtab?
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2013-04-26 16:27:08 UTC
And exactly same discussion in archlinux:
What's interesting there, that current solution they are going to implement is to remove '-n' option from mount command line as they "never write to /etc/mtab anyway".
Comment 8 Peter Volkov (RETIRED) gentoo-dev 2013-05-11 17:19:35 UTC
Created attachment 347990 [details]

@openrc: please, review patch. Personally I don't see why can't we use `mount -f /` to add entry into mtab and as a side effect have this bug fixed.
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2013-05-14 09:25:49 UTC
Comment on attachment 347990 [details]

Well I need better test patch. I'll try another time later.
Comment 10 Peter Volkov (RETIRED) gentoo-dev 2013-10-14 06:34:14 UTC
Guys, is this bug reproducible with sys-fs/nilfs-utils-2.1.5-r1? I guess that libmount changes could fix this issue as well.