Comment 7 for bug 1667512

Revision history for this message
atom (atom) wrote : Re: update-initramfs hangs on upgrade, dpkg unusable, unbootable system

Me too.

Turns out the problem for me is updating *while* copying a hard-drive (in another terminal).

The "update-initramfs" script calls "sync" in the "generate_initramfs" function. For me, copying hard-drives at the same time caused "sync" to hang: Then the whole thing hangs.

I CTRL-Z'd (TSTP) my rsync process (doing the copying), and a few seconds later update-initramfs un-hung. Finished without a problem.

Proposed workarounds:
1- stop/pause large disk i/o operations while updating, or
2- edit "/usr/sbin/update-initramfs": comment out the "sync" command in the "generate_initramfs" function

This is why Ubuntu (and other Linux distros) needs a user-space "fsync" command; so instead of trying to sync busy drives that could be busy for days, it can just "fsync ${file}" and get on with the day.

Not sure if this will fix anyone else's problems, but it's all unicorns and rainbows over here, now.