Commit b089681c authored by James T. Lee's avatar James T. Lee
Browse files

fstab: Use full device name rather than fs labels

The swap label can only hold 15 characters, making it less useful for
systems with long hostnames.  The underlying device name is already
persistent so there is no need to use filesystem labels.
parent e43f5b8a
...@@ -273,13 +273,13 @@ END ...@@ -273,13 +273,13 @@ END
destructive_cmd zfs create -V "$swap_size" -b 4096 -o refreservation=none "${zroot}/swap" destructive_cmd zfs create -V "$swap_size" -b 4096 -o refreservation=none "${zroot}/swap"
destructive_cmd udevadm settle destructive_cmd udevadm settle
destructive_cmd mkswap -L "${name}-swap" "/dev/zvol/${zroot}/swap" destructive_cmd mkswap "/dev/zvol/${zroot}/swap"
if grep "${name}-fscache" "${img}/etc/fstab" > /dev/null; then if grep "${name}-fscache" "${img}/etc/fstab" > /dev/null; then
task "Creating fscache..." task "Creating fscache..."
destructive_cmd zfs create -V 2G "${zroot}/fscache" destructive_cmd zfs create -V 2G "${zroot}/fscache"
destructive_cmd udevadm settle destructive_cmd udevadm settle
destructive_cmd mkfs.ext4 -L "${name}-fscache" "/dev/zvol/${zroot}/fscache" destructive_cmd mkfs.ext4 "/dev/zvol/${zroot}/fscache"
destructive_cmd tune2fs -o discard "/dev/zvol/${zroot}/fscache" destructive_cmd tune2fs -o discard "/dev/zvol/${zroot}/fscache"
fi fi
......
...@@ -26,7 +26,7 @@ class nest::base::fstab { ...@@ -26,7 +26,7 @@ class nest::base::fstab {
], ],
'swap' => [ 'swap' => [
"set 3/spec LABEL=${hostname}-swap", "set 3/spec /dev/zvol/${facts['rpool']}/swap",
'set 3/file none', 'set 3/file none',
'set 3/vfstype swap', 'set 3/vfstype swap',
'set 3/opt discard', 'set 3/opt discard',
...@@ -46,7 +46,7 @@ class nest::base::fstab { ...@@ -46,7 +46,7 @@ class nest::base::fstab {
], ],
'nest-fscache' => [ 'nest-fscache' => [
"set 5/spec LABEL=${hostname}-fscache", "set 5/spec /dev/zvol/${facts['rpool']}/fscache",
'set 5/file /var/cache/fscache', 'set 5/file /var/cache/fscache',
'set 5/vfstype ext4', 'set 5/vfstype ext4',
'set 5/opt[1] defaults', 'set 5/opt[1] defaults',
......
Markdown is supported
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