LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-06-2019, 05:27 PM   #1
Driekus
LQ Newbie
 
Registered: Oct 2019
Posts: 2

Rep: Reputation: Disabled
Resizing Raid 6 Array


New to the forum and really hoping someone can help. My linux knowledge is average and I am no expert.

I have an encrypted Raid 6 array with 6 drives. I have added the 7 drive using the grow command with Webmin.

I have been roughly following the below link
http://jotschi.de/2014/02/09/lvm-mda...debian-wheezy/

I was able to resize the crypt layer using the cryptsetup command.

Code:
# Resize the crypt layer and check the result
  cryptsetup resize cryptotest
  fdisk -l /dev/mapper/cryptotest

  # Resize physical volume and check the result
  pvresize /dev/mapper/cryptotest
  pvdisplay

  # Resize logical volume and check result
  lvextend -l +100%FREE /dev/mapper/testvg-testlv
  lvdisplay

  # Resize filesystem
  e2fsck -f /dev/mapper/testvg-testlv
  resize2fs /dev/mapper/testvg-testlv
  mount /dev/mapper/testvg-testlv test
The problem I have is that when I run pvresize I get the following error.

Code:
root@peter-X10SL7-F:/media/Raid# pvresize /dev/mapper/Raid
  Failed to find physical volume "/dev/mapper/Raid".
  0 physical volume(s) resized / 0 physical volume(s) not resized
Indeed pvdisplay and lvdisplay come up blank when I enter those commands.
pvs does show the volume but only when I do the "pvs -a"

Code:
root@peter-X10SL7-F:/media/Raid# pvs -a
  PV                     VG Fmt Attr PSize PFree
  /dev/mapper/Raid              ---     0     0 
  /dev/mapper/cryptswap1        ---     0     0 
  /dev/md0                      ---     0     0 
  /dev/sda1                     ---     0     0 
  /dev/sda5                     ---     0     0 
  /dev/sdb1                     ---     0     0
I have included output from mdadm

Code:
root@peter-X10SL7-F:/media/Raid# mdadm --detail /dev/md0
/dev/md0:
           Version : 1.2
     Creation Time : Thu May 14 16:11:40 2015
        Raid Level : raid6
        Array Size : 19534425600 (18629.48 GiB 20003.25 GB)
     Used Dev Size : 3906885120 (3725.90 GiB 4000.65 GB)
      Raid Devices : 7
     Total Devices : 7
       Persistence : Superblock is persistent

       Update Time : Sun Oct  6 16:11:21 2019
             State : clean 
    Active Devices : 7
   Working Devices : 7
    Failed Devices : 0
     Spare Devices : 0

            Layout : left-symmetric
        Chunk Size : 512K

Consistency Policy : resync

              Name : mint:0
              UUID : 12c9466f:10054afa:7a70f710:a476c3cf
            Events : 13332

    Number   Major   Minor   RaidDevice State
       0       8       81        0      active sync   /dev/sdf1
       6       8       33        1      active sync   /dev/sdc1
       2       8       49        2      active sync   /dev/sdd1
       3       8       97        3      active sync   /dev/sdg1
       4       8       65        4      active sync   /dev/sde1
       5       8      129        5      active sync   /dev/sdi1
       7       8      112        6      active sync   /dev/sdh
Code:
root@peter-X10SL7-F:/media/Raid# fdisk -l /dev/mapper/Raid
Disk /dev/mapper/Raid: 18.2 TiB, 20003249717248 bytes, 39068847104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes

Any help on what to do next would be appreciated.
 
Old 10-08-2019, 05:08 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
From the pvs man page:
Quote:
--all
Include information in the output about devices that have not been initialized with pvcreate(8).
Your -a option is an alias of --all.

/dev/mapper/Raid exists, but it's not a physical volume. pvs -a lists all storage devices on your system, but none of them is a PV.

If I understand you right, you created a RAID device, encrypted it, then created a physical volume on the encrypted device.
You then grew the RAID device, resized the encryption layer, and boom the physical volume structures have disappeared. Perhaps one of the steps didn't work and you didn't see the error messages? Is anything in the kernel message buffer or the system log?

Perhaps we can see something if you share the precise commands that you issued.

By the way, I would probably create the PV on the RAID, create logical volumes and encrypt the LVs rather than creating a PV on an encrypted device. However, I don't see why your approach shouldn't work.

Last edited by berndbausch; 10-08-2019 at 05:12 AM.
 
Old 10-08-2019, 10:52 PM   #3
Driekus
LQ Newbie
 
Registered: Oct 2019
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
From the pvs man page:

Your -a option is an alias of --all.

/dev/mapper/Raid exists, but it's not a physical volume. pvs -a lists all storage devices on your system, but none of them is a PV.

If I understand you right, you created a RAID device, encrypted it, then created a physical volume on the encrypted device.
You then grew the RAID device, resized the encryption layer, and boom the physical volume structures have disappeared. Perhaps one of the steps didn't work and you didn't see the error messages? Is anything in the kernel message buffer or the system log?

Perhaps we can see something if you share the precise commands that you issued.

By the way, I would probably create the PV on the RAID, create logical volumes and encrypt the LVs rather than creating a PV on an encrypted device. However, I don't see why your approach shouldn't work.

The grow command that I used was in the Webmin interface. Likely the command is similar to below.

Code:
mdadm --add /dev/md2 /dev/loop2

  mdadm --add /dev/md2 /dev/loop3
  mdadm --grow --raid-devices=4 /dev/md2
The only other command I successfully executed is

Code:
  cryptsetup resize cryptotest
  fdisk -l /dev/mapper/cryptotest
Would the pvcreate, vgcreate and lvcreate erase the existing data on the disk? The Raid was setup 4 years ago so I cannot remember exactly all the commands that were done. I am preparing a backup drive for the data before I risk expanding the array.
 
Old 10-09-2019, 01:02 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Driekus View Post
Would the pvcreate, vgcreate and lvcreate erase the existing data on the disk? The Raid was setup 4 years ago so I cannot remember exactly all the commands that were done. I am preparing a backup drive for the data before I risk expanding the array.
pvcreate creates an LVM header, which vgcreate and lvcreate then modify. The header is probably not large, but it obviously overwrites whatever was there before.

Assuming the encrypted RAID device was a physical volume before, I wonder if the LVM header is still there but at a different location. I am sure there are tools that scan a disk for LVM data and perhaps repair a situation like yours.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] resizing a RAID-1 array anctop Linux - Server 1 02-29-2016 01:29 AM
BASH-Adding array element: Naming issue using array[${#array[*]}]=5 calvarado777 Programming 8 07-26-2013 09:48 PM
unable to unmount raid array or unable to stop raid array karthik-naren Linux - Newbie 3 07-09-2013 01:54 PM
[SOLVED] Resizing linux raid 1 array lpallard Linux - Software 7 09-20-2011 11:34 AM
[SOLVED] Resizing window content when resizing window? (Debian squeeze) mike11 Linux - Newbie 2 03-04-2010 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration