FS#39724 - [linux] [mkinitcpio] [coreutils] shutdown hook copies /new_root to /run

Attached to Project: Arch Linux
Opened by Sandeep (sandy8925) - Wednesday, 02 April 2014, 23:18 GMT
Last edited by Dave Reisner (falconindy) - Friday, 04 April 2014, 19:02 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Dave Reisner (falconindy)
Sébastien Luttringer (seblu)
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
Installed Linux 3.14 from testing repository. System fails to boot after checking filesystem with intense hard drive activity. (or so it would seem - the hard drive LED light was constant)
Same problem occurs in two different Arch installs on different machines. Each machine has different hardware.

Additional info:
* package version(s) - Linux 3.14 -1 and -2
* config and/or log files etc.
None - unable to boot system

Steps to reproduce:
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 04 April 2014, 19:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  coreutils 8.22-4
Comment by Sandeep (sandy8925) - Wednesday, 02 April 2014, 23:19 GMT
System boots correctly with older kernel (linux 3.13.6 - I had compiled it myself earlier for a different purpose).
Comment by Alessandro Rosetti (paradox) - Thursday, 03 April 2014, 06:55 GMT
Same problem. I see _a_lot_ of error messages.
I don't remember the exact error format but to be more specific for the bug report:
"Error /run/.../new_root/...$file_name No space left on drive."
There are also access denied on /proc.. etc.

It could be a problem in the initram or systemd triggered only by 3.14.
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 08:19 GMT
This looks like a problem with the shutdown hook, are you using that?

Dave, this looks like cp -ax going nuts and trying to copy the contents of /new_root into /run (which -x should prevent). Any idea what is going on here? (As a side note: shouldn't we just retire the shutdown hook? Its functionality has been superceded by mkinitcpio-generate-shutdown-ramfs.service.)
Comment by Alessandro Rosetti (paradox) - Thursday, 03 April 2014, 08:31 GMT
yes I am using shutdown hook.
I think my laptop ( Asus U36SD ) needs that hook in order to shutdown correctly. ( maybe I don't need it anymore )

I had this strange problem with bbswitch to keep nvidia video card off.
After using that the system wouldn't actually turn off after shutdown started. so I had to add the hook.

My current hooks:
HOOKS="base udev autodetect modconf block fsck shutdown bbswitch"

I'll try to remove, update kernel and see what happens.

!! [EDIT] !!:

Ok now I can boot linux-3.14 and shutdown correctly.

at boot I get a message:
switch_root: old root filesystem is not an initramfs: Success

at shutdown a series of:
unmounting /oldroot/{sys,run,dev}
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 09:12 GMT
The shutdown hook has been superceded by the aforementioned service, which is enabled by default.
Comment by Claire Farron (clfarron4) - Thursday, 03 April 2014, 09:29 GMT
Okies, so the solution looks to be removing the [shutdown] hook?

I also had this problem, as I outlined here: https://bbs.archlinux.org/viewtopic.php?id=179456

@brain0: Is the new service just enabled for 3.14 by default or for previous kernels as well?

@paradox: As for your new message of "switch_root", see this discussion here: https://bbs.archlinux.org/viewtopic.php?id=179422
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 09:44 GMT
Not really a solution, since there must be something really wrong for the shutdown hook to break this way.
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 12:54 GMT
Dave, Sebastien, this is from coreutils src/copy.c, function copy_internal and it affects cp -x:

/* Decide whether to copy the contents of the directory. */
if (x->one_file_system && device != 0 && device != src_sb.st_dev)

This check obviously fails if device == 0 - but the device of rootfs is 0 with 3.14. Therefore, cp -x ignores the file system boundary between rootfs and /new_root.

This function is called twice, once with an actual st_dev as an argument for device, and once with 0 (which is supposed to mean "we did not pass a device").
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 18:36 GMT
testing/coreutils 8.22-4 fixes this problem. shutdown hook shouldn't cause this problem anymore. Can anyone confirm?
Comment by Sandeep (sandy8925) - Thursday, 03 April 2014, 18:42 GMT
I will try testing to see if it works.

Also, I had chroot'd into the system from a Ubuntu 13.10 Live CD, and rebuilt initramfs using mkinitcpio, and then was able to boot with kernel 3.14 . Rebuilding initramfs from within the Arch install once again, causes this problem to appear.
Comment by Sandeep (sandy8925) - Thursday, 03 April 2014, 19:07 GMT
@brain0 : Is the service you mentioned, a systemd service? Is it enabled by default, or is it something that would need to be manually turned on after removing the shutdown hook?
Comment by Thomas Bächler (brain0) - Thursday, 03 April 2014, 19:57 GMT
It is enabled by default in systemd provided you don't use the shutdown hook.
Comment by Claire Farron (clfarron4) - Thursday, 03 April 2014, 22:23 GMT
@brain0: testing/coreutils 8.22-4 fixes this hook problem for me on both laptops.
Comment by Sandeep (sandy8925) - Thursday, 03 April 2014, 23:17 GMT
Same here, tested on one Arch install and the problem appears to be fixed. I will test on the other Arch install sometime today and report back here.

Loading...