
In this tutorial, I will show you how to perform the following steps on your HP Proliant server:
create a new volume with hpssacli
create the physical volume, volume group and logical group with lvm
transfer the system from the old to the new volume
This tutorial can be useful if you do not want to reinstall the system from scratch and restore a backup.
Create a new volume with hpssacli
First step, update your /etc/apt/sources.list and add the repository :
deb http://downloads.linux.hp.com/SDR/repo/mcp trusty/current non-free
Run the following commands :
apt-get install add-apt-key && add-apt-key FADD8D64B1275EA3 apt-get update apt-get install hpssacli
Create a new volume with hpssacli. In the following example, I will create a simple RAID1 volume :
> hpssacli => ctrl all show status Smart Array P440ar in Slot 0 (Embedded) Controller Status: OK Cache Status: OK Battery/Capacitor Status: OK => ctrl slot=0 pd all show Smart Array P440ar in Slot 0 (Embedded) array A physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 600 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 600 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 600 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 600 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 600 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 600 GB, OK) unassigned physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 300 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 300 GB, OK) => ctrl slot=0 create type=ld drives=2I:1:7,2I:1:8 raid=1 => ctrl slot=0 pd all show Smart Array P440ar in Slot 0 (Embedded) array A physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 600 GB, OK) physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 600 GB, OK) physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 600 GB, OK) physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 600 GB, OK) physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 600 GB, OK) physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 600 GB, OK) array B physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 300 GB, OK) physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 300 GB, OK) => ctrl slot=0 ld 2 show Smart Array P440ar in Slot 0 (Embedded) array B Logical Drive: 2 Size: 279.4 GB Fault Tolerance: 1 Heads: 255 Sectors Per Track: 32 Cylinders: 65535 Strip Size: 256 KB Full Stripe Size: 256 KB Status: OK Caching: Enabled Unique Identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Disk Name: /dev/sdc Mount Points: None Logical Drive Label: lllllllllllllllllllllllllllll Mirror Group 0: physicaldrive 2I:1:7 (port 2I:box 1:bay 7, SAS, 300 GB, OK) Mirror Group 1: physicaldrive 2I:1:8 (port 2I:box 1:bay 8, SAS, 300 GB, OK) Drive Type: Data LD Acceleration Method: Controller Cache => quit
In the last command you can see the new disk name that will be used under lvm (Disk Name: /dev/sdc)
> ls -l /dev/sdc* brw-rw---- 1 root disk 8, 32 Mar xx 11:36 /dev/sdc
Partition creation with cfdisk (fdisk do not support gpt disks)
Disk: /dev/sdc Size: 279.4 GiB, 299966445568 bytes, 585871964 sectors Label: gpt, identifier: 12345678-1234-1234-1234-123456789123 Device Start End Sectors Size Type /dev/sdc1 2048 1050623 1048576 512M EFI System /dev/sdc2 1050624 1550335 499712 244M Linux filesystem >> /dev/sdc3 1550336 585871930 584321595 278.6G Linux LVM
Do not forget to write the partition table and validate by typing “yes”.
LVM part
> lvm lvm> pvcreate /dev/sdc3 lvm> vgcreate sysvg /dev/sdc3 Volume group "sysvg" successfully created lvm> lvcreate -n swap_1 -L 64G sysvg Logical volume "swap_1" created lvm> lvcreate -n root -l 100%FREE sysvg Logical volume "root" created lvm> quit
Transfer your system to the new created volume
Format the new volume
mkfs -t ext4 /dev/mapper/sysvg-root
Mount it and copy files
mount /dev/mapper/sysvg-root /mnt rsync -avP --numeric-ids --exclude='/dev' --exclude='/proc' --exclude='/sys' / /mnt/
Install grub on the new volume
sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /sys /mnt/sys sudo mount -t proc /proc /mnt/proc sudo chroot /mnt /bin/bash mount -a apt-get install grub-pc update-grub grub-install /dev/sdc
And reboot !
My Powershell script categories
- Active Directory
- Cluster
- Database
- Exchange
- Files and folders
- Hardware
- Network
- Operating System
- PKI
- SCCM
- Service and process
- Tips
- VMWare