Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

fsck partition before mount #1081

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions rootfs/rootfs/bootscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ echo "-------------------"

# Allow local bootsync.sh customisation
if [ -e /var/lib/boot2docker/bootsync.sh ]; then
/bin/sh /var/lib/boot2docker/bootsync.sh
echo "------------------- ran /var/lib/boot2docker/bootsync.sh"
#copy bootsync.sh to /tmp before run ,so we can umount and fsck disk ,then remount:)
cp /var/lib/boot2docker/bootsync.sh /tmp/bootsync.sh
/bin/sh /tmp/bootsync.sh
echo "------------------- ran /var/lib/boot2docker/bootsync.sh "
fi

# Launch Docker
Expand Down
6 changes: 5 additions & 1 deletion rootfs/rootfs/etc/rc.d/automount
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ echo $BOOT2DOCKER_DATA

if [ -n "$BOOT2DOCKER_DATA" ]; then
PARTNAME=`echo "$BOOT2DOCKER_DATA" | sed 's/.*\///'`

echo "fsck $BOOT2DOCKER_DATA"
fsck -y $BOOT2DOCKER_DATA

echo "mount p:$PARTNAME ..."
mkdir -p /mnt/$PARTNAME
if ! mount $BOOT2DOCKER_DATA /mnt/$PARTNAME 2>/dev/null; then
Expand All @@ -91,7 +95,7 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
umount -f /mnt/$PARTNAME || true
mount $BOOT2DOCKER_DATA /mnt/$PARTNAME
fi

# Just in case, the links will fail if not
umount -f /var/lib/docker || true
rm -rf /var/lib/docker /var/lib/boot2docker
Expand Down