Koozali.org: home of the SME Server

SME 8 with RAID 1 - how doI use more of the disk

Offline aussierob

  • **
  • 55
  • +0/-0
SME 8 with RAID 1 - how doI use more of the disk
« on: September 16, 2010, 05:38:03 AM »
Hi forum,
I'm thinking this is a poor question, but it is born out of ignorance,
so advice would be appreciated (I have looked lots of places and am STILL ignorant!)

I installed SME8b5 with RAID1 on a pair of 1TB drives: all was easy [SME rocks].
The result of fdisk -l for both drives, df -k and /proc/mdstat are below.

My questions are
1. it seems that /dev/sda1 is 100MB so is that the filesystem /boot ?
2. this the other filesystem are a small part of /dev/sda2 ?
3. the other filesystems total 22GB, how do I
3a. make a new filesystem to use more (say 400GB for virtual machines)?
and 3b. enlarge an existing filesystem (other than make a new, mv data across and change mounts)?

So TIA to anyone with more knowledge than me and time to reply
Kind Regards Aussierob (downunder)


[root@central ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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      121601   976655610   fd  Linux raid autodetect
[root@central ~]# fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 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      121601   976655610   fd  Linux raid autodetect

[root@central ~]# df -v
Filesystem                         1K-blocks       Used    Available Use% Mounted on
/dev/mapper/main-root       4062912   2314400   1538800  61% /
/dev/mapper/main-tmp       4062912    139464   3713736   4% /tmp
/dev/mapper/main-files       8125880    706052   7000400  10% /home/e-smith/files
/dev/mapper/main-var        4062912    239300   3613900   7% /var
/dev/md1                            101018      12137       83665  13% /boot
tmpfs                                2071240             0    2071240   0% /dev/shm

[root@central ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb1[1] sda1[0]
            104320 blocks [2/2] [UU]
     
md2 : active raid1 sdb2[1] sda2[0]
      976655488 blocks [2/2] [UU]
     
unused devices: <none>

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #1 on: September 16, 2010, 02:48:56 PM »
Hi.

Looks like you've installed your server with sme multipart option. This option will create different LVM logical volume for the following partition: / /tmp /var and /home/e-smith/files. When using this option, all your disk is not used, in order to let the admin put place where he needs. Here are some quick steps to add unused space to /home/e-smith/files (it's an example, and is valid for the other partition as well):

First, you need to check the name of the LVM logical volume your file system is on:
Code: [Select]
[root@sme ~]# mount | grep '/home/e-smith/files'
/dev/mapper/main-files on /home/e-smith/files type ext3 (rw,usrquota,grpquota,acl)

Here, the FS is on /dev/mapper/main-files. Now, we need to see how much space is available in our LVM volume group (the volume group is main):

Code: [Select]
[root@sas ~]# vgdisplay main | egrep 'Free.*PE'
  Free  PE / Size       2248 / 70,25 GB
[root@sas ~]#
In this example, there's 70Go unallocated. So, lets add 50Go to /home/e-smith/files.

Code: [Select]
[root@sas ~]# lvextend -L+50G main/files

Now that the block device is extended, you also need to extend the file system. This can be done online using resize2fs (or ext2online on SME 7):

Code: [Select]
[root@sas ~]# resize2fs /home/e-smith/files

Now you can see that your FS is 50GB larger than before. And (thanks to LVM), everything has been done online, without any interruption.

Regards, Daniel
C'est la fin du monde !!! :lol:

Offline aussierob

  • **
  • 55
  • +0/-0
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #2 on: September 17, 2010, 05:15:50 AM »
Thanks for the good summary, Daniel.

Yes I did install with 'sme multipart' (and sme raid=1 too) - sorry I omitted to mention that.

Please note: after completing, the filesystem was not larger, and on researching the resize2fs,
it seemed I needed to do one more command line
Code: [Select]
"resize2fs /dev/mapper/main-files" - which after long wait for 800GB addition, looked the right result
(FYI the filesystem 'grows' incrementally during the process - df -v gives more space every use: this is my first try with LVM and its very good).

I presume this is a valid addition to your advice? if it is no reply is needed, but if I have done wrong I would appreciate knowing.

Thanks again for the good guidance
aussierob

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #3 on: September 17, 2010, 06:58:10 AM »
Sorry, indeed, resize2fs requires the block device as argument. Only the old (deprecated in sme8) ext2online was also working with the mount point.

Regards, Daniel
C'est la fin du monde !!! :lol:

Offline aussierob

  • **
  • 55
  • +0/-0
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #4 on: September 17, 2010, 08:47:09 AM »
Sorry, indeed, resize2fs requires the block device as argument
No problem - I am glad I figured it out, and just wanted to pass it back to help the next person.

Just one other thought is that /proc/mdstat still shows below (even after a reboot, in case that updates it)
and I would have expected the md1 blocks to increase
 cat /proc/mdstat 
Personalities : [raid1]
md1 : active raid1 sdb1[1] sda1[0]
      104320 blocks [2/2] [UU]
     
md2 : active raid1 sdb2[1] sda2[0]
      976655488 blocks [2/2] [UU]

even now that df -v shows
 df -v
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root      4062912    2313352    1539848  61% /
/dev/mapper/main-tmp      4062912     139476     3713724   4% /tmp
/dev/mapper/main-files  820717408  76158412 702206768  10% /home/e-smith/files
/dev/mapper/main-var       4062912     240112     3613088   7% /var
/dev/md1                            101018      12137         83665  13% /boot
tmpfs                                2071240             0      2071240   0% /dev/shm

Thanks again for your help - as you can see I'm off and running with 76GB already in my ibay


Offline slords

  • ****
  • 235
  • +3/-0
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #5 on: September 17, 2010, 06:20:15 PM »
Multipart install is for those that understand lvm and how to grow/split filesystems.  If you don't understand how to use lvm and grow/shrink filesystems then you shouldn't be using multipart.
"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 CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: SME 8 with RAID 1 - how doI use more of the disk
« Reply #6 on: September 21, 2010, 03:30:17 AM »
Just one other thought is that /proc/mdstat still shows below (even after a reboot, in case that updates it)
and I would have expected the md1 blocks to increase

Why would you expect that? You've done nothing to change it.

/dev/md1 is fixed size, and contains /boot. You don't need to change it.