Skip to content

Commit

Permalink
[union-mount] Rescan dev if root partition disapear (#298)
Browse files Browse the repository at this point in the history
On some platforms after the initramfs init scripts have mounted the root device its
block device disapear from /dev. The union-mount script therefore can't mount the
root device over the aufs. If this case happen, issue a rescan of the devices to
repopulate the /dev filesystem.
  • Loading branch information
Staphylo authored and lguohan committed Feb 16, 2017
1 parent 877291a commit 89a695a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions files/initramfs-tools/union-mount.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ esac
## Mount the aufs file system: rw layer over squashfs
mkdir -p ${rootmnt}/host/rw
mount -n -o dirs=${rootmnt}/host/rw:${rootmnt}=ro -t aufs root-aufs ${rootmnt}
## Check if the root block device is still there
[ -b ${ROOT} ] || mdev -s
## Mount the raw partition again
mount ${ROOT} ${rootmnt}/host
## Mount the working directory of docker engine in the raw partition, bypass the aufs
Expand Down

0 comments on commit 89a695a

Please sign in to comment.