Add a disk with SSM

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 ! :grinning:

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. :wink:

4 Likes

I’m making some other command line output…

http://www.unix.com/man-page/centos/8/ssm/

Consider this like a draft:

[root@microserver ~]# 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   46.25 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.24 GB  linear  /home      
/dev/vg_microserver/opt   vg_microserver    931.52 GB  xfs    931.06 GB  931.06 GB  linear             
/dev/sda1                                     1.00 GB  xfs   1014.00 MB  830.64 MB  part    /boot      
/dev/sdc1                                   250.98 MB  vfat                                            
-------------------------------------------------------------------------------------------------------
[root@microserver ~]# ssm remove /dev/sdb
  Physical volume "/dev/sdb" still in use
SSM Info: Unable to remove '/dev/sdb'
SSM Error (2001): Nothing was removed!
[root@microserver ~]# ssm unmount /dev/vg_microserver/opt
usage: ssm [-h] [--version] [-v] [-f] [-b BACKEND] [-n]
           {check,resize,create,list,add,remove,snapshot,mount} ...
ssm: error: argument too few arguments: invalid choice: 'unmount' (choose from 'check', 'resize', 'create', 'list', 'add', 'remove', 'snapshot', 'mount')
[root@microserver ~]# ssm remove  /dev/vg_microserver/opt
Do you really want to remove active logical volume vg_microserver/opt? [y/n]: y
  Logical volume "opt" successfully removed
[root@microserver ~]# 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   46.25 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  830.64 MB  part    /boot      
/dev/sdc1                                   250.98 MB  vfat                                            
-------------------------------------------------------------------------------------------------------
[root@microserver ~]# ssm remove  /dev/sdb
  Removed "/dev/sdb" from volume group "vg_microserver"
[root@microserver ~]# 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   46.25 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  830.64 MB  part    /boot      
/dev/sdc1                                   250.98 MB  vfat                                            
-------------------------------------------------------------------------------------------------------
[root@microserver ~]# ssm add -p vg_microserver /dev/sdb
  Volume group "vg_microserver" successfully extended
[root@microserver ~]# 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   46.25 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  830.64 MB  part    /boot      
/dev/sdc1                                   250.98 MB  vfat                                            
-------------------------------------------------------------------------------------------------------
[root@microserver ~]# ssm create -s 100%FREE -n backup --fstype xfs -p vg_microserver
WARNING: xfs signature detected on /dev/vg_microserver/backup at offset 0. Wipe it? [y/n]: y
  Wiping xfs signature on /dev/vg_microserver/backup.
  Logical volume "backup" created.
meta-data=/dev/vg_microserver/backup 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
[root@microserver ~]# 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   46.25 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/backup  vg_microserver    931.52 GB  xfs    931.06 GB  931.06 GB  linear             
/dev/sda1                                       1.00 GB  xfs   1014.00 MB  830.64 MB  part    /boot      
/dev/sdc1                                     250.98 MB  vfat                                            
---------------------------------------------------------------------------------------------------------

Bad thing as usual the “space” in the name

# ssm mount /dev/vg_microserver/backup /var/lib/nethserver/ibay/Time Machine
usage: ssm [-h] [--version] [-v] [-f] [-b BACKEND] [-n]
           {check,resize,create,list,add,remove,snapshot,mount} ...
ssm: error: unrecognized arguments: Machine
[root@microserver ~]# ssm mount /dev/vg_microserver/backup '/var/lib/nethserver/ibay/Time Machine'
[root@microserver ~]# 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   46.25 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/backup
           vg_microserver    931.52 GB  xfs    931.06 GB  931.06 GB  linear  /var/lib/nethserver/ibay/Time\040Machine
/dev/sda1                      1.00 GB  xfs   1014.00 MB  830.64 MB  part    /boot                                   
/dev/sdc1                    250.98 MB  vfat                                                                         
---------------------------------------------------------------------------------------------------------------------
[root@microserver ~]# ssm mount /dev/vg_microserver/backup /var/lib/nethserver/ibay/Backup
[root@microserver ~]# 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   46.25 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/backup  vg_microserver    931.52 GB  xfs    931.06 GB  931.06 GB  linear  /var/lib/nethserver/ibay/Backup
/dev/sda1                                       1.00 GB  xfs   1014.00 MB  830.64 MB  part    /boot                          
/dev/sdc1                                     250.98 MB  vfat                                                                
-----------------------------------------------------------------------------------------------------------------------------
[root@microserver etc]#  vi fstab

#------------------------------------------------------------
# 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-backup  /var/lib/nethserver/ibay/Backup    xfs     defaults        0 0
/dev/mapper/vg_microserver-swap swap    swap    defaults        0 0

A post was merged into an existing topic: Upgrade Nethserver 6.9 to 7 study case