diff options
author | Brian Behlendorf <[email protected]> | 2013-12-13 11:29:06 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-12-16 09:46:10 -0800 |
commit | c2d439dffd4c404d39e82e5b174a338515080f26 (patch) | |
tree | 0b18c780d5f702a010ceb986074f186ffe122bbf /scripts | |
parent | ce37ebd2ebcbc8ec6bbaa56cd22e6e807b6d36f3 (diff) |
Silence e2fsck warning in zconfig.sh
When running zconfig.sh test 7 and 8 cause the following warning to
be printed to the console. It's caused because we're snapshoting a
mounted ext2 filesystem which is not in a 'clean' state. This is
to be expected since we have no guarentees about the on-disk
consistency of the filesystem.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
To silence the warning and preserve the intent of these test cases
they have been updated to unmount the filesystem prior to snapshoting
them. This ensures the ext2 filesystem is in a consistent state
when the snapshot is taken.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ned Bass <[email protected]>
Closes #1972
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/zconfig.sh | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh index 281166c59..622bb28f1 100755 --- a/scripts/zconfig.sh +++ b/scripts/zconfig.sh @@ -403,14 +403,16 @@ test_7() { partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4 format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5 - # Mount the ext2 filesystem and copy some data to it. - mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 6 - mount /dev/zvol/${FULL_ZVOL_NAME}-part1 /tmp/${ZVOL_NAME}-part1 \ - || fail 7 + # Snapshot the pristine ext2 filesystem. + ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 6 + wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 7 - # Snapshot the pristine ext2 filesystem and mount it read-only. - ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 8 - wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 8 + # Mount the ext2 filesystem so some data can be copied to it. + mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 7 + mount /dev/zvol/${FULL_ZVOL_NAME}-part1 \ + /tmp/${ZVOL_NAME}-part1 || fail 8 + + # Mount the pristine ext2 snapshot. mkdir -p /tmp/${SNAP_NAME}-part1 || fail 9 mount /dev/zvol/${FULL_SNAP_NAME}-part1 \ /tmp/${SNAP_NAME}-part1 &>/dev/null || fail 10 @@ -496,11 +498,14 @@ test_8() { mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \ /tmp/${FULL_ZVOL_NAME1}-part1 || fail 7 cp -RL ${SRC_DIR} /tmp/${FULL_ZVOL_NAME1}-part1 || fail 8 - sync || fail 9 - # Snapshot the ext2 filesystem so it may be sent. - ${ZFS} snapshot ${FULL_SNAP_NAME1} || fail 11 - wait_udev /dev/zvol/${FULL_SNAP_NAME1} 30 || fail 11 + # Unmount, snapshot, mount the ext2 filesystem so it may be sent. + # We only unmount to ensure the ext2 filesystem is clean. + umount /tmp/${FULL_ZVOL_NAME1}-part1 || fail 9 + ${ZFS} snapshot ${FULL_SNAP_NAME1} || fail 10 + wait_udev /dev/zvol/${FULL_SNAP_NAME1} 30 || fail 10 + mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \ + /tmp/${FULL_ZVOL_NAME1}-part1 || 11 # Send/receive the snapshot from POOL_NAME1 to POOL_NAME2 (${ZFS} send ${FULL_SNAP_NAME1} | \ |