Koozali.org: home of the SME Server

Reduce Partition Size

Offline ewolf

  • *
  • 10
  • +0/-0
Reduce Partition Size
« on: January 14, 2008, 10:03:37 PM »
I have a client running SME 7.2. The trouble is that the are in the middle of nowhere running on a Generator which shuts down every night and so the raid array never fully rebuilds.

It has 250GB HDD's in it. Is there any problem in reducing the partition sizes , there is not a lot of data so the raid arrays rebuild within 8 hours.
and if so whats the best way to do it. boot from a GPPARTED disk ?

Cheers.

Offline Gaston94

  • *****
  • 184
  • +0/-0
Re: Reduce Partition Size
« Reply #1 on: January 15, 2008, 12:50:56 PM »
Hi,
I have never run this kind of work, but let me share my though : shrinking your FS and then the LV, will not give you the expected result.
The LVM structure is built on the raid device, which mean, that the RAID device is definitely not linked to any LVM size aspect (or any other aspects furthermore) : the reconstruction won't speed up.

I would say, the good way should be :
 - buy a working UPS which will shutdown properly the server should the main power fail again
and
 - backup the current server
 - install two new smaller disks,
 - restore.

G.

Offline ewolf

  • *
  • 10
  • +0/-0
Re: Reduce Partition Size
« Reply #2 on: January 15, 2008, 01:46:44 PM »
The diesel generator doesn't fail it is turned of at night when they go home. so they shut it down, the reconstruction restarts the next day.

I only need like a 3 or 5 gig partition to hold their data.
and rebuilding a small partition is definitely quicker.

Don't quite understand  the LVM is built on the raid device does this mean  i need a custom LVM size and the rest that that entails ?


Offline Gaston94

  • *****
  • 184
  • +0/-0
Re: Reduce Partition Size
« Reply #3 on: January 15, 2008, 02:47:12 PM »
If the diesel generator is shut down on a regular basis, you should provide the correct procedure to the users to shutdown the server before they stop the diesel generator.
If you don't want (or can't) let your user shutting down the server (you can for instance create a user which only task will be to launch the shutdown process for instance - use a really strong password :oops: - look how the user "admin" is used for launching the server console) , an UPS look the correct thing : with the fine one (I cannot provide advice on this) you can handle the main power source outage and forward to the server an automatic shutdown order (I am nearly certain a contrib exist to manage UPS). What you'll have to look closely is how the UPS battery will handle to be fully discharged every night.

Your issue on the raid : from a standard two disks installation, two partition on which two raid devices have been created : one small to handle /boot and one overall the rest of the disk and used with a LVM structure.
On this LVM structure a FS has been created. Shrinking down the FS size, and the LV size will not make any change on the raid size : you are just acting on logical usage of the raid device. The raid device is not shrunk, neither the partition, so, from my understanding, you will reconstruct part of a raid of nothing but you will reconstruct it nevertheless.

I would really look at a proper way to shutdown the server, it's really not a good usage to have a server being powered off with no more care

G.

Offline ewolf

  • *
  • 10
  • +0/-0
Re: Reduce Partition Size
« Reply #4 on: January 16, 2008, 01:09:35 AM »
Okay i haven't stated this clearly.

They Server is started at 6.00 am every morning and shutdown at 4.00 pm every afternoon.
this is so the diesal generator that powers the sight can be shutdown at night around 5.00pm.


however the amount of time that the system is on, 10 hours, does not give the system time to reconstruct a
200gb mirror array. and so the next day at start up is start reconstructing the disk array again, and never finishes doing it.

now I could possibly get them to leave the diesel generator on overnight for one night, but this doesn't solve the bigger problem
that if a disk gets kicked from the array and needs to be rebuilt, it wont happen, and the system runs very slowly when rebuilding the array and never finishes it.

So what i want to do is only use say 10gb of the 250gb drive in the raid device. (this may be silly, but even 160GB drives would still be too big)
SO i am assuming i would need to manually create the two partitions that i want, and then manually create the LVM on that.
I have searched these form and can find nothing on doing this.
actually using less of the disk than is available in the raid device.

so from what i have read,
1) I do an install with no LVM and manually create the partition sizes for the raid device.

2) Read up on LVM's and manually create the raid device, and the LVM so that i can expand it if necessary.

Unless I have misssed something.

Cheers Andrew



Offline thomasch

  • *
  • 232
  • +0/-0
Re: Reduce Partition Size
« Reply #5 on: January 16, 2008, 04:24:00 AM »
Try to tune up your raid speed limit.

Check /proc/sys/dev/raid/speed_limit_min

Change to a higher speed, say 10000.. this will speed up raid sync.
Be careful, if you set too high, it will eat up your CPU cycle and render your system unusable
« Last Edit: January 16, 2008, 04:33:24 AM by thomasch »

Offline ewolf

  • *
  • 10
  • +0/-0
Re: Reduce Partition Size
« Reply #6 on: January 16, 2008, 04:59:05 AM »
The system was just about unusuable at the current speed limit.

I think part of that problem may be that they are SATA drives and the system is not using DMA on them.
(THat's the other bit i have to check out.)
in HDD TUNE
Read cached was 1500 MB/s
read uncached was only at about 6 MB/s

Is there a way to install SME with less than the whole disk on the raid file system.

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Reduce Partition Size
« Reply #7 on: January 16, 2008, 05:42:06 AM »
ewolf

That seems a long time for your drives to resync. I think it takes about 2 or 3 hours for 2x SATA 300Gb drives to resync with about 150Gb of space used on a Pentium 2GHz box, so you better check if something is wrong ie drives not running at optimal speed.

I don't know if this is possible , but you could look at the commands to grow hard disk size and see if you can do the reverse ie reduce the size
From
http://wiki.contribs.org/index.php?title=SME_Server:Documentation:Technical_Manual:Booklet#Hard_Drives_.E2.80.93_Raid

Upgrading the Hard Drive Size

    * CAUTION MAKE A FULL BACKUP!
    * Ensure you have e-smith-base-4.16.0-33 or newer installed. [or Update to at least 7.1.3]

   1. Shut down and install larger drive in system.
   2. Boot up and manage raid to add new (larger) drive to system.
   3. Wait for raid to fully sync.
   4. Repeat steps 1-3 until all drives in system are upgraded to larger capacity.
   5. Ensure all drives have been replace with larger drives and array is in sync and redundant!
   6. Issue the following commands:
         1. mdadm --grow /dev/md2 --size=max
         2. pvresize /dev/md2
         3. lvresize -l +$(vgdisplay -c main | cut -d: -f16) main/root [-l (lower case L)]
         4. ext2online -C0 /dev/main/root [is -C0 (zero)]

Notes :

    * All of this can be done while the server is up and running with the exception of #1.
    * These instructions should work for any raid level you have as long as you have >= 2 drives
    * If you have disabled lvm

   1. you don't need the pvresize or lvresize command
   2. the final line becomes ext2online -C0 /dev/md2 (or whatever / is mounted to)
...

Offline ewolf

  • *
  • 10
  • +0/-0
Re: Reduce Partition Size
« Reply #8 on: January 16, 2008, 06:05:06 AM »
All right so that tends to indicate I have some sort of I/o Problem
Here is a paste of the messge log at load.
Is it the PIO system bus and Libata 2.0 with no DMA the possible problem ?

Its an E4400 C2D on a P5VD2-VM-SE with 512 MB ram 2 x seagate 250gb ST3250620NS

Jan  4 16:45:05 server kernel: RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
Jan  4 16:45:05 server kernel: divert: not allocating divert_blk for non-ethernet device lo
Jan  4 16:45:05 server kernel: Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
Jan  4 16:45:05 server kernel: ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Jan  4 16:45:05 server kernel: Probing IDE interface ide0...
Jan  4 16:45:05 server kernel: hda: ST3250310AS, ATA DISK drive
Jan  4 16:45:05 server kernel: Probing IDE interface ide1...
Jan  4 16:45:05 server kernel: hdc: ST3250310AS, ATA DISK drive
Jan  4 16:45:05 server kernel: Probing IDE interface ide2...
Jan  4 16:45:05 server kernel: Probing IDE interface ide3...
Jan  4 16:45:05 server kernel: Probing IDE interface ide4...
Jan  4 16:45:05 server kernel: Probing IDE interface ide5...
Jan  4 16:45:05 server kernel: Using cfq io scheduler
Jan  4 16:45:05 server kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Jan  4 16:45:05 server kernel: ide1 at 0x170-0x177,0x376 on irq 15
Jan  4 16:45:05 server kernel: hda: max request size: 1024KiB
Jan  4 16:45:05 server kernel: hda: Host Protected Area detected.
Jan  4 16:45:05 server kernel:    current capacity is 488395055 sectors (250058 MB)
Jan  4 16:45:05 server kernel:    native  capacity is 488397168 sectors (250059 MB)
Jan  4 16:45:05 server kernel: hda: 488395055 sectors (250058 MB) w/8192KiB Cache, CHS=30401/255/63
Jan  4 16:45:05 server kernel: hda: cache flushes supported

CSI subsystem initialized
Jan  4 16:45:06 server kernel: libata version 2.00 loaded.
Jan  4 16:45:06 server kernel: ata_piix 0000:00:1f.2: version 2.00ac7
Jan  4 16:45:06 server kernel: ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ]
Jan  4 16:45:06 server kernel: ACPI: PCI Interrupt 0000:00:1f.2 -> GSI 19 (level, low) -> IRQ 185
Jan  4 16:45:06 server kernel: ata: 0x1F0 IDE port busy
Jan  4 16:45:06 server kernel: ata: conflict with ide0
Jan  4 16:45:06 server kernel: ata: 0x170 IDE port busy
Jan  4 16:45:06 server kernel: ata: conflict with ide1
Jan  4 16:45:06 server kernel: ata_piix: probe of 0000:00:1f.2 failed with error -16
Jan  4 16:45:06 server kernel: device-mapper: 4.5.5-ioctl (2006-12-01) initialised: dm-devel@redhat.com
Jan  4 16:45:06 server kernel: md: raid1 personality registered as nr 3
Jan  4 16:45:06 server kernel: md: md1 stopped.
Jan  4 16:45:06 server kernel: md: bind<hdc1>
Jan  4 16:45:06 server kernel: md: bind<hda1>
Jan  4 16:45:06 server kernel: raid1: raid set md1 active with 2 out of 2 mirrors
Jan  4 16:45:06 server kernel: md: md2 stopped.
Jan  4 16:45:06 server kernel: md: bind<hdc2>
Jan  4 16:45:06 server kernel: md: bind<hda2>
Jan  4 16:45:06 server kernel: raid1: raid set md2 active with 1 out of 2 mirrors
Jan  4 16:45:06 server kernel: RAID1 conf printout:
Jan  4 16:45:06 server kernel:  --- wd:1 rd:2
Jan  4 16:45:06 server kernel:  disk 0, wo:0, o:1, dev:hda2
Jan  4 16:45:06 server kernel:  disk 1, wo:1, o:1, dev:hdc2
Jan  4 16:45:06 server kernel: md: syncing RAID array md2
Jan  4 16:45:06 server kernel: md: minimum _guaranteed_ reconstruction speed: 1000 KB/sec/disc.
Jan  4 16:45:06 server kernel: md: using maximum available idle IO bandwith (but not more than 200000 KB/sec) for reconstruction.
Jan  4 16:45:06 server kernel: md: using 128k window, over a total of 244091520 blocks.

Thanks for the suggestions.

Wonder if i have a bad block or something on the second drive.

Trouble is the bloody place is 3 hours drive away and no satellite broadband isn't installed yet.
« Last Edit: January 16, 2008, 06:18:02 AM by ewolf »