Commit 39cd5ee4 authored by Mike Hibler's avatar Mike Hibler
Browse files

Make it work with NOSHAREDFS.

If LVM is not being used, then the code will attempt to make the extra FS
and use that for /vz.  However, in the NOSHAREDFS world, that filesystem
has already been made and is mounted on /local.  So check for that case and
just create a subdir/symlink: /vz -> /local/vz.
parent c36cdc96
......@@ -216,18 +216,39 @@ sub vz_rootPreConfig {
mysystem("vgchange -a y openvz");
}
else {
#
# We need to create a local filesystem.
# First see if the "extra" filesystem has already been created,
# Emulab often mounts it as /local for various purposes.
#
# about the funny quoting: don't ask... emacs perl mode foo.
if (system('grep -q '."'".'^/dev/.*/vz.*$'."'".' /etc/fstab')) {
mysystem("$VZRC stop");
mysystem("rm -rf /vz")
if (-e "/vz");
mysystem("mkdir /vz");
mysystem("$MKEXTRAFS -f /vz");
mysystem("cp -pR /vz.save/* /vz/");
mysystem("touch /vz/.nolvm");
if (!system('grep -q '."'".'^/dev/.*/local.*$'."'".' /etc/fstab')) {
# local filesystem already exists, just create a subdir
if (! -d "/local/vz") {
mysystem("$VZRC stop");
mysystem("mkdir /local/vz");
mysystem("cp -pR /vz.save/* /local/vz/");
mysystem("touch /local/vz/.nolvm");
}
if (-e "/vz") {
mysystem("rm -rf /vz");
mysystem("ln -s /local/vz /vz");
}
}
if (system('mount | grep -q \'on /vz\'')) {
mysystem("mount /vz");
else {
# about the funny quoting: don't ask... emacs perl mode foo.
if (system('grep -q '."'".'^/dev/.*/vz.*$'."'".' /etc/fstab')) {
mysystem("$VZRC stop");
mysystem("rm -rf /vz")
if (-e "/vz");
mysystem("mkdir /vz");
mysystem("$MKEXTRAFS -f /vz");
mysystem("cp -pR /vz.save/* /vz/");
mysystem("touch /vz/.nolvm");
}
if (system('mount | grep -q \'on /vz\'')) {
mysystem("mount /vz");
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment