Koozali.org: home of the SME Server

resize array

Offline wjp79

  • *
  • 17
  • +0/-0
resize array
« on: April 20, 2011, 10:01:36 AM »
Helle people,

I'm running sme server 7.5.1. Some time ago I replaced the 80 GB drives with 500GB drives.
But now the array is only 80 GB instead of 500GB.

I executed the following commands
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE vg_primary/lb_root ( The first install was SME 6 I believe), so no main/root)
ext2online -C0 /dev/vg_primary/lv_root

But the Array stays 80GB.
What am I doing wrong?



Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #1 on: April 20, 2011, 10:24:02 AM »
please post the output of

Code: [Select]
mount

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #2 on: April 20, 2011, 11:58:21 AM »
mount
/dev/mapper/vg_primary-lv_root on / type ext3 (rw,usrquota,grpquota,acl)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/md1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #3 on: April 20, 2011, 12:09:50 PM »
lvresize -l +100%FREE vg_primary/lb_root ( The first install was SME 6 I believe), so no main/root)

is it a typo?

please post the output of
Code: [Select]
lvdisplay


Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #4 on: April 20, 2011, 12:48:38 PM »
Yes, typo..

lvdisplay
  --- Logical volume ---
  LV Name                /dev/vg_primary/lv_root
  VG Name                vg_primary
  LV UUID                0jc7mI-2W5Q-oS4z-7oR7-qFvq-mtlH-izgVGD
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                75.22 GB
  Current LE             2407
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/vg_primary/lv_swap
  VG Name                vg_primary
  LV UUID                hAv4VV-L3cS-L0TH-Ij4A-VPif-Bfjf-MbCgYI
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GB
  Current LE             32
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #5 on: April 20, 2011, 01:00:07 PM »
ok.. please, the output of

Code: [Select]
mdadm --detail /dev/md2

and of
Code: [Select]
pvdisplay

thank you

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #6 on: April 20, 2011, 01:06:18 PM »
mdadm --detail /dev/md2
/dev/md2:
        Version : 00.90.01
  Creation Time : Sat Mar 18 16:07:10 2006
     Raid Level : raid1
     Array Size : 79931328 (76.23 GiB 81.85 GB)
    Device Size : 79931328 (76.23 GiB 81.85 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Wed Apr 20 13:03:09 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 33516cd3:f4f5daab:252b3e70:3391fd66
         Events : 0.39855148

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2

pvdisplay
  --- Physical volume ---
  PV Name               /dev/md2
  VG Name               vg_primary
  PV Size               76.23 GB / not usable 9.75 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              2439
  Free PE               0
  Allocated PE          2439
  PV UUID               bfhOUb-OvQh-DH5T-Dh6C-Cpql-Lcpu-d8JFWH

also did a fdisk -l

 fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   fd  Linux raid autodetect
/dev/sda2              14        9964    79931407+  fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   fd  Linux raid autodetect
/dev/sdb2              14        9964    79931407+  fd  Linux raid autodetect

Disk /dev/md1: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 81.8 GB, 81849679872 bytes
2 heads, 4 sectors/track, 19982832 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
2 heads, 4 sectors/track, 262144 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       60801   488384001    7  HPFS/NTFS




Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #7 on: April 20, 2011, 01:13:52 PM »
ok..

the resizing has failed.. I don't know why

now, please, do
Code: [Select]
mdadm --grow /dev/md2 --size=max

and then
Code: [Select]
mdadm --detail /dev/md2

Offline p-jones

  • *
  • 594
  • +0/-0
Re: resize array
« Reply #8 on: April 20, 2011, 01:16:43 PM »
Quote
lvresize -l +100%FREE vg_primary/lb_root

Should this not just be  "lvresize -l +100%FREE vg_primary/root"  ??
...

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #9 on: April 20, 2011, 01:25:35 PM »
executed
mdadm --grow /dev/md2 --size=max
mdadm --detail /dev/md2

        Version : 00.90.01
  Creation Time : Sat Mar 18 16:07:10 2006
     Raid Level : raid1
     Array Size : 79931328 (76.23 GiB 81.85 GB)
    Device Size : 79931328 (76.23 GiB 81.85 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2
    Persistence : Superblock is persistent

    Update Time : Wed Apr 20 13:21:31 2011
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           UUID : 33516cd3:f4f5daab:252b3e70:3391fd66
         Events : 0.39855632

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2


exectuted:
lvresize -l +100%FREE vg_primary/root
  Logical volume root not found in volume group vg_primary

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #10 on: April 20, 2011, 01:35:10 PM »
mdadm --grow failed..

did you see any error?

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #11 on: April 20, 2011, 02:43:26 PM »
No. Is there a log file?

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #12 on: April 20, 2011, 02:49:02 PM »
take a look at /var/log/messages

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #13 on: April 20, 2011, 03:16:42 PM »
I did another  mdadm --grow /dev/md2 --size=max

But nothing showed up in /var/log/messages or the console.


Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #14 on: April 20, 2011, 03:30:38 PM »
please raise a bug in bugzilla.. use this 3ad as reference and report here the bug id for future readers.

follow up only in bugzilla, thank you

Offline wjp79

  • *
  • 17
  • +0/-0
Re: resize array
« Reply #15 on: April 20, 2011, 03:45:11 PM »
Ok, raised a bug.

http://bugs.contribs.org/show_bug.cgi?id=6602

Tnx for you effort.

WJ


Offline MSmith

  • *
  • 675
  • +0/-0
Re: resize array
« Reply #16 on: April 21, 2011, 05:01:00 PM »
Poof, "closed, notabug."  I don't know what would fix the OP's issue, but one approach going forward would be to back up to USB drive, then reformat & restore.  And just for safety, perhaps do the fresh install on only one of the 500GB drives until you're sure the restore went OK, then wipe the other 500GB drive and use the built-in SME tool to add it to the array.
...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: resize array
« Reply #17 on: April 22, 2011, 08:48:28 PM »
the resizing has failed.. I don't know why

It looks to me that there is substantial unpartitioned space on the drives. /dev/sda2 and /dev/sdb2 are < 10k cylinders, but there are more than 60k cylinders to the drives. LVM is using all of the RAID, but the RAID is not using all of the drives.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #18 on: April 22, 2011, 08:57:37 PM »
It looks to me that there is substantial unpartitioned space on the drives. /dev/sda2 and /dev/sdb2 are < 10k cylinders, but there are more than 60k cylinders to the drives. LVM is using all of the RAID, but the RAID is not using all of the drives.

this is the problem :-)

with the
Code: [Select]
mdadm --grow /dev/md2 --size=max

raid should grow and use all the disk space.. I did use that command many times without any problem

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: resize array
« Reply #19 on: April 23, 2011, 04:44:28 PM »
with the
Code: [Select]
mdadm --grow /dev/md2 --size=max

raid should grow and use all the disk space.. I did use that command many times without any problem

I think that will only work if /dev/sda2 and /dev/sdb2 span the remainder of the disk. I don't think that mdadm will change the partition sizes and repartition the disk. It will only 'grow' to use unused space within the partitions.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #20 on: April 23, 2011, 04:53:51 PM »
I think that will only work if /dev/sda2 and /dev/sdb2 span the remainder of the disk. I don't think that mdadm will change the partition sizes and repartition the disk. It will only 'grow' to use unused space within the partitions.

Charlie.. I've used many (dozen) times this procedure.. and it simply worked flawlessy for me.. without touching partitions..

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: resize array
« Reply #21 on: April 23, 2011, 05:27:25 PM »
Charlie.. I've used many (dozen) times this procedure.. and it simply worked flawlessy for me.. without touching partitions..

Interesting. Would be good to see the fdisk output before and after "mdadm --grow" is run.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: resize array
« Reply #22 on: April 23, 2011, 06:42:30 PM »
I'll create a VM this night to test and post here the result

Offline slords

  • *****
  • 235
  • +3/-0
Re: resize array
« Reply #23 on: April 23, 2011, 09:29:28 PM »
The issue is the instructions on the wiki were not followed.  If the instructions were followed then the partitions on the drives would be different (the second partition would take up the entire drive).

Please explain exactly how you replaced the 80G drives with the 500G drives.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -- Rich Cook

Offline johnp

  • *****
  • 312
  • +0/-0
Re: resize array
« Reply #24 on: April 24, 2011, 02:39:12 AM »
Here's a link to the instructions Shad referred to http://wiki.contribs.org/Raid

Offline p-jones

  • *
  • 594
  • +0/-0
Re: resize array
« Reply #25 on: April 24, 2011, 07:34:12 AM »
Quote
Here's a link to the instructions Shad referred to http://wiki.contribs.org/Raid

Wonder what specific part of this Document Shad is reffering to ? It is a long document.....

The instructions wjp79 is using are also contained in this link/document and like Stefano, I have used those instructions a number of times and they have "just worked"
...

Offline slords

  • *****
  • 235
  • +3/-0
Re: resize array
« Reply #26 on: April 24, 2011, 04:08:28 PM »
I'm referring to the very first part of "Upgrading the Hard Drive Size".  If you don't do the first part of the procedure correct then nothing else beyond that matters.  All of the instructions given here so far assume that was done correctly when it wasn't.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs,
and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." -- Rich Cook