All of lore.kernel.org
 help / color / mirror / Atom feed
* xfsprogs should provide hook script for initramfs-tools
@ 2013-07-03 20:40 Lubomir Host
  2013-07-03 21:26 ` Eric Sandeen
  2013-07-03 23:12 ` Dave Chinner
  0 siblings, 2 replies; 3+ messages in thread
From: Lubomir Host @ 2013-07-03 20:40 UTC (permalink / raw)
  To: XFS Development Team


[-- Attachment #1.1: Type: text/plain, Size: 2119 bytes --]

Package: xfsprogs
Version: 3.1.9
Severity: minor
Tags: patch

Dear Maintainer,

If your rootfs is XFS (I hope it is :) ), you should include some XFS tools
into initrd.
It would be handy in emergency situation. E.g. will help you to boot your
domU.

Log from the Xen console:

Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 2.88 booting
[info] Using makefile-style concurrent boot in runlevel S.
[ ok ] Starting the hotplug events dispatcher: udevd.
[ ok ] Synthesizing the initial hotplug events...done.
[ ok ] Waiting for /dev to be fully populated...done.
[ ok ] Activating swap...done.
[....] Checking root file system...fsck from util-linux 2.20.1
fsck: fsck.xfs: not found
fsck: error 2 while executing fsck.xfs for /dev/xvda2
fsck died with exit status 8
failed (code 8).
[....] An automatic file system check (fsck) of the root filesystem failed.
A manual fsck must be performed, then the system restarted. The fsck should
be performed in maintenance mo[FAILth the root filesystem mounted in
read-only mode. ... failed!
[....] The root filesystem is currently mounted in read-only mode. A
maintenance shell will now be started. After performing system maintenance,
press CONTROL-D to terminate the main[warnce shell and restart the system.
... (warning).
Give root password for maintenance
(or type Control-D to continue):


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.9-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=sk_SK, LC_CTYPE=sk_SK.UTF-8 (charmap=ANSI_X3.4-1968) (ignored:
LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages xfsprogs depends on:
ii  libblkid1     2.20.1-5.4
ii  libc6         2.17-7
ii  libreadline5  5.2+dfsg-2
ii  libuuid1      2.20.1-5.4

xfsprogs recommends no packages.

Versions of packages xfsprogs suggests:
ii  acl      2.2.52-1
pn  attr     <none>
pn  quota    <none>
pn  xfsdump  <none>

-- no debconf information


-- 
http://blog.hostname.sk/ <http://blog.hostname.sk/gmail>debianbug

[-- Attachment #1.2: Type: text/html, Size: 2953 bytes --]

[-- Attachment #2: initramfs-tools.hooks.xfsprogs.txt --]
[-- Type: text/plain, Size: 608 bytes --]

#!/bin/sh

PREREQ=""

prereqs()
{
	echo "$PREREQ"
}

case $1 in
prereqs)
	prereqs
	exit 0
	;;
esac

if [ ! -x /sbin/xfs_repair ]; then
	exit 0
fi

. /usr/share/initramfs-tools/hook-functions

for x in xfs_copy xfs_db xfs_admin xfs_check xfs_ncheck xfs_metadump xfs_estimate xfs_fsr xfs_growfs xfs_info xfs_io xfs_bmap xfs_freeze xfs_mkfile xfs_logprint xfs_quota xfs_mdrestore xfs_rtcp; do
	copy_exec /usr/sbin/$x
done
copy_exec /sbin/xfs_repair
copy_exec /sbin/mkfs.xfs

cp -p /sbin/mkfs.xfs "${DESTDIR}/sbin"
cp -p /sbin/fsck.xfs "${DESTDIR}/sbin"

for x in libcrc32c xfs; do
	manual_add_modules ${x}
done

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfsprogs should provide hook script for initramfs-tools
  2013-07-03 20:40 xfsprogs should provide hook script for initramfs-tools Lubomir Host
@ 2013-07-03 21:26 ` Eric Sandeen
  2013-07-03 23:12 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2013-07-03 21:26 UTC (permalink / raw)
  To: Lubomir Host; +Cc: XFS Development Team

On 7/3/13 4:40 PM, Lubomir Host wrote:
> Package: xfsprogs
> Version: 3.1.9
> Severity: minor
> Tags: patch
> 
> Dear Maintainer,
> 
> If your rootfs is XFS (I hope it is :) ), you should include some XFS tools into initrd.
> It would be handy in emergency situation. E.g. will help you to boot your domU.
> 
> Log from the Xen console:
> 
> Begin: Running /scripts/local-bottom ... done.
> done.
> Begin: Running /scripts/init-bottom ... done.
> INIT: version 2.88 booting
> [info] Using makefile-style concurrent boot in runlevel S.
> [ ok ] Starting the hotplug events dispatcher: udevd.
> [ ok ] Synthesizing the initial hotplug events...done.
> [ ok ] Waiting for /dev to be fully populated...done.
> [ ok ] Activating swap...done.
> [....] Checking root file system...fsck from util-linux 2.20.1
> fsck: fsck.xfs: not found

Quite honestly, this should not be a hard failure.

I'd call this a bug in whatever infrastructure has decided to
fail boot for lack of a no-op binary (i.e. fsck.xfs).

> fsck: error 2 while executing fsck.xfs for /dev/xvda2
> fsck died with exit status 8
> failed (code 8).
> [....] An automatic file system check (fsck) of the root filesystem
> failed. A manual fsck must be performed, then the system restarted.
> The fsck should be performed in maintenance mo[FAILth the root
> filesystem mounted in read-only mode. ... failed!

Failed all right, but there's no reason to fail boot for this.

Anyway -

I had looked into including the $FOO.d/$BAR.conf files required
to include xfs bits, but at least in Fedora, it already pulled
in the right bits.

So yes, indicating xfs_repair, xfs_db, xfs_metadump for initramfs
would probably be a fine idea for distros that don't do it by default,
but failing boot for lack of fsck.xfs is awfully harsh.

This might be a per-distro-package thing, if Debian needs different
hints than Fedora, etc, to get a working boot-time environment?

-Eric

> [....] The root filesystem is currently mounted in read-only mode. A
> maintenance shell will now be started. After performing system
> maintenance, press CONTROL-D to terminate the main[warnce shell and
> restart the system. ... (warning).> Give root password for maintenance
> (or type Control-D to continue):
> 
> 
> -- System Information:
> Debian Release: jessie/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 3.9-1-amd64 (SMP w/2 CPU cores)
> Locale: LANG=sk_SK, LC_CTYPE=sk_SK.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
> Shell: /bin/sh linked to /bin/dash
> 
> Versions of packages xfsprogs depends on:
> ii  libblkid1     2.20.1-5.4
> ii  libc6         2.17-7
> ii  libreadline5  5.2+dfsg-2
> ii  libuuid1      2.20.1-5.4
> 
> xfsprogs recommends no packages.
> 
> Versions of packages xfsprogs suggests:
> ii  acl      2.2.52-1
> pn  attr     <none>
> pn  quota    <none>
> pn  xfsdump  <none>
> 
> -- no debconf information
> 
> 
> -- 
> http://blog.hostname.sk/ <http://blog.hostname.sk/gmail>debianbug
> 
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfsprogs should provide hook script for initramfs-tools
  2013-07-03 20:40 xfsprogs should provide hook script for initramfs-tools Lubomir Host
  2013-07-03 21:26 ` Eric Sandeen
@ 2013-07-03 23:12 ` Dave Chinner
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2013-07-03 23:12 UTC (permalink / raw)
  To: Lubomir Host; +Cc: XFS Development Team

On Wed, Jul 03, 2013 at 10:40:16PM +0200, Lubomir Host wrote:
> Package: xfsprogs
> Version: 3.1.9
> Severity: minor
> Tags: patch
> 
> Dear Maintainer,
> 
> If your rootfs is XFS (I hope it is :) ), you should include some XFS tools
> into initrd.
> It would be handy in emergency situation. E.g. will help you to boot your
> domU.

Debian doesn't include any filesystem utilities in the initramfs,
not even the fsck binary.

> Log from the Xen console:
> 
> Begin: Running /scripts/local-bottom ... done.
> done.
> Begin: Running /scripts/init-bottom ... done.
> INIT: version 2.88 booting
> [info] Using makefile-style concurrent boot in runlevel S.
> [ ok ] Starting the hotplug events dispatcher: udevd.
> [ ok ] Synthesizing the initial hotplug events...done.
> [ ok ] Waiting for /dev to be fully populated...done.
> [ ok ] Activating swap...done.
> [....] Checking root file system...fsck from util-linux 2.20.1
> fsck: fsck.xfs: not found
> fsck: error 2 while executing fsck.xfs for /dev/xvda2
> fsck died with exit status 8
> failed (code 8).

I don't see how this is initramfs problem - the root filesystem
should be mounted read only at this point, and so all the fsck
binaries should be available to the rcS.d scripts. Indeed, where did
it find the fsck binary from?

> . /usr/share/initramfs-tools/hook-functions
> 
> for x in xfs_copy xfs_db xfs_admin xfs_check xfs_ncheck xfs_metadump xfs_estimate xfs_fsr xfs_growfs xfs_info xfs_io xfs_bmap xfs_freeze xfs_mkfile xfs_logprint xfs_quota xfs_mdrestore xfs_rtcp; do
> 	copy_exec /usr/sbin/$x
> done
> copy_exec /sbin/xfs_repair
> copy_exec /sbin/mkfs.xfs

I don't think that's advisable:

$ ldd /usr/sbin/xfs_db
        linux-vdso.so.1 (0x00007fff607fe000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f98702fb000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f98700f3000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f986fed6000)
        libreadline.so.5 => /lib/x86_64-linux-gnu/libreadline.so.5 (0x00007f986fc95000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f986f8e8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9870511000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f986f6be000)

Those are not static binaries, and so cannot be used in a initramfs
environment. They'd rely on the root filesystem being mounted read
only and having all these libraries in the search path.  And if
you've got that, then you should also have the binaries themselves
on the read-only root filesystem, yes?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-03 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03 20:40 xfsprogs should provide hook script for initramfs-tools Lubomir Host
2013-07-03 21:26 ` Eric Sandeen
2013-07-03 23:12 ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.