How to add a disk in Nethserver with System Storage Manager
With CentOS 7.x, LVM don’t exist anymore, now the equivalent it SSM.
We will see how to add a hard drive in an existing Virtual Group.
Version and revision: V1.0 / R1
Skill: General audience.
Published: 2017-06-06 / R1
Author: Jim
Contact: Nethserver community forum: Jim
At first, I`m strongly recommending to read this SSM Administrator’s Guide:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch-ssm.html
There’s all you need to understand what is SSM and how to play safely with it.
First, we need to install the SSM package, all these comment are done throughout a SSH connection to the NethServer instance:
# yum install storage-system-manager
In my Microserver Gen8 I have one 160 GB disk in the bay one. This one was configuring like this (sim list output:
# ssm list
---------------------------------------------------------------------
Device Free Used Total Pool Mount point
---------------------------------------------------------------------
/dev/sda 149.05 GB PARTITIONED
/dev/sda1 1.00 GB /boot
/dev/sda2 8.00 MB 148.04 GB 148.05 GB vg_microserver
/dev/sdb 931.51 GB
/dev/sdc 256.00 MB
/dev/sdc1 250.98 MB
---------------------------------------------------------------------
------------------------------------------------------------
Pool Type Devices Free Used Total
------------------------------------------------------------
vg_microserver lvm 1 8.00 MB 148.04 GB 148.05 GB
------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
Volume Pool Volume size FS FS size Free Type Mount point
-------------------------------------------------------------------------------------------------------
/dev/vg_microserver/root vg_microserver 50.00 GB xfs 49.98 GB 47.47 GB linear /
/dev/vg_microserver/swap vg_microserver 3.75 GB linear
/dev/vg_microserver/home vg_microserver 94.29 GB xfs 94.24 GB 94.21 GB linear /home
/dev/sda1 1.00 GB xfs 1014.00 MB 848.59 MB part /boot
/dev/sdc1 250.98 MB vfat
-------------------------------------------------------------------------------------------------------
When I went to put one more 1Tb disk in the second bay, I didn`t want to simply add one
partition, but wanted to expend the LVM volume to have flexibility of LVM for futures upgrades.
As you can see in the previous output there’s an unused /dev/sdb
The pool vg_microserver , with the volumes /root, swap and /home are from a fresh CentOS minimal installation.
I want to use the 1tb drive entirely for a Time Machine Backup, from a SMB share.
I will use this disk mounted in the /opt directory
So, I add the /dev/sdb in the vg_microserver pool:
#ssm add -p vg_microserver /dev/sdb
Physical volume "/dev/sdb" successfully created.
Volume group "vg_microserver" successfully extended
To check, let’s do another ssm list
# ssm list
-----------------------------------------------------------------------
Device Free Used Total Pool Mount point
-----------------------------------------------------------------------
/dev/sda 149.05 GB PARTITIONED
/dev/sda1 1.00 GB /boot
/dev/sda2 8.00 MB 148.04 GB 148.05 GB vg_microserver
/dev/sdb 931.51 GB 0.00 KB 931.51 GB vg_microserver
/dev/sdc 256.00 MB
/dev/sdc1 250.98 MB
-----------------------------------------------------------------------
------------------------------------------------------------
Pool Type Devices Free Used Total
------------------------------------------------------------
vg_microserver lvm 2 931.52 GB 148.04 GB 1.05 TB
------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
Volume Pool Volume size FS FS size Free Type Mount point
-------------------------------------------------------------------------------------------------------
/dev/vg_microserver/root vg_microserver 50.00 GB xfs 49.98 GB 47.47 GB linear /
/dev/vg_microserver/swap vg_microserver 3.75 GB linear
/dev/vg_microserver/home vg_microserver 94.29 GB xfs 94.24 GB 94.21 GB linear /home
/dev/sda1 1.00 GB xfs 1014.00 MB 848.59 MB part /boot
/dev/sdc1 250.98 MB vfat
As you can see the the /dev/sdb in in the vg_microserver pool with 0 byte used.
I want this Volume to be mount in /opt, formatted with xfs so:
# ssm create -s 100%FREE -n opt --fstype xfs -p vg_microserver -o /dev/vg_microserver/opt
SSM Warning: Mount options are set, but no mount point was provided. Device will not be mounted!
WARNING: xfs signature detected on /dev/vg_microserver/opt at offset 0. Wipe it? [y/n]: n
Aborted wiping of xfs.
1 existing signature left on the device.
Logical volume "opt" created.
meta-data=/dev/vg_microserver/opt isize=512 agcount=4, agsize=61048064 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=244192256, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=119234, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
For an little unknown error, the volume wasn’t mount in /opt
So, let’s go mount this volume:
# mount /dev/vg_microserver/opt /opt
The final check:
# ssm list
---------------------------------------------------------------------
Device Free Used Total Pool Mount point
---------------------------------------------------------------------
/dev/sda 149.05 GB PARTITIONED
/dev/sda1 1.00 GB /boot
/dev/sda2 0.00 KB 148.05 GB 148.05 GB vg_microserver
/dev/sdb 0.00 KB 931.51 GB 931.51 GB vg_microserver
/dev/sdc 256.00 MB
/dev/sdc1 250.98 MB
---------------------------------------------------------------------
--------------------------------------------------------
Pool Type Devices Free Used Total
--------------------------------------------------------
vg_microserver lvm 2 0.00 KB 1.05 TB 1.05 TB
--------------------------------------------------------
-------------------------------------------------------------------------------------------------------
Volume Pool Volume size FS FS size Free Type Mount point
-------------------------------------------------------------------------------------------------------
/dev/vg_microserver/root vg_microserver 50.00 GB xfs 49.98 GB 47.47 GB linear /
/dev/vg_microserver/swap vg_microserver 3.75 GB linear
/dev/vg_microserver/home vg_microserver 94.29 GB xfs 94.24 GB 94.21 GB linear /home
/dev/vg_microserver/opt vg_microserver 931.52 GB xfs 931.06 GB 931.06 GB linear /opt
/dev/sda1 1.00 GB xfs 1014.00 MB 848.59 MB part /boot
/dev/sdc1 250.98 MB vfat
To be consistent and complete, let’s go adjust the /etc/fstab file to automatically mount the partition at startup
#------------------------------------------------------------
# BE CAREFUL WHEN MODIFYING THIS FILE! It is updated automatically
# by the NethServer software. A few entries are updated during
# the template processing of the file and white space is removed,
# but otherwise changes to the file are preserved.
#------------------------------------------------------------
/dev/mapper/vg_microserver-root / xfs defaults,acl,user_xattr 0 0
UUID=71329c37-83e1-41ea-bb24-f0039d542f42 /boot xfs defaults 0 0
/dev/mapper/vg_microserver-home /home xfs defaults 0 0
/dev/mapper/vg_microserver-opt /opt xfs defaults 0 0
/dev/mapper/vg_microserver-swap swap swap defaults 0 0
That’s all !
Before creating the wiki page, I would like to submit here this how to, particularly to correct the ssm create -s 100%FREE -n opt --fstype xfs -p vg_microserver -o /dev/vg_microserver/opt command to mount automatically the volume.