mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-18 10:21:01 +03:00
24 lines
519 B
Bash
24 lines
519 B
Bash
|
case "$root" in
|
||
|
zfs:FILESYSTEM=*|FILESYSTEM=*)
|
||
|
root="${root#zfs:}"
|
||
|
root="zfs:${root#FILESYSTEM=}"
|
||
|
rootfs="zfs"
|
||
|
rootok=1 ;;
|
||
|
zfs:ZFS=*|ZFS=*)
|
||
|
root="${root#zfs:}"
|
||
|
root="zfs:${root#ZFS=}"
|
||
|
rootfs="zfs"
|
||
|
rootok=1 ;;
|
||
|
esac
|
||
|
|
||
|
if [ "$rootok" != "1" ] ; then
|
||
|
zpool import -aN
|
||
|
zfsbootfs=`zpool list -H -o bootfs | grep -v ^-$ -m 1`
|
||
|
if [ -n "$zfsbootfs" ] ; then
|
||
|
root="zfs:$zfsbootfs"
|
||
|
rootfs="zfs"
|
||
|
rootok=1
|
||
|
fi
|
||
|
zpool list -H | while read fs rest ; do zpool export "$fs" ; done
|
||
|
fi
|