Sugesstion on space scarcity

Fraser Campbell fraser-eicrhRFjby5dCsDujFhwbypxlwaOVQ5f at public.gmane.org
Mon Dec 20 16:50:02 UTC 2004


On Monday 20 December 2004 03:08, JM wrote:

>   Since PG lacks tablespace as of the said version... ( they are working on
> in it on ver 8.0 )  and I havent heard of anyone doing soft links on data
> files for a production server.
>
>
>   My Disk Setup: RAID 1
>
>   Im just wondering if its possible to replace the disk with a higher
> capacity.  eventually the box will do a mirror on the new disk.  After the
> mirror replace the other disk....

The way I've been setting up systems lately is:

- raid1 /boot at beginning of both disks (128MB)
- raid1 remainder of disks
- make one large volume group on the large raid1
- create logical volumes on the volume group for all the filesystems you need

You could do the upgrade like this:

- create 2 failed raid1 arrays on the new disk (1 big, 1 small)
- create VG and LVs like I suggested above
- move data over to the logical volumes
- reboot into new system running only from new disk
- pull the old disk that's too small for your needs
- add a matching sized disk, partition and add it into your raid arrays to
  complete the mirrors, after synchronization finishes reboot to make sure
  everything is ok

If you aren't familiar with LVM then the above can be hairy.  Even if you are 
something can still go wrong so have a backup and rescue disk handy.  The 
approach above never overwrites your original system disk so as long as 
you're careful there is little risk.

If your current system were using LVM then you could just go to single user 
mode, unmount the partition in question and type:

    lvresize  -L10G /dev/vg0/var
    e2fsck -f /dev/vg0/var
    resize2fs /dev/vg0/var

... and then go back to multiuser.  Some filesystems supposedly support online 
resizing though I haven't tried it.

The other nice thing about LVM (in case you're not familiar with it) is that 
down the road if your new disks turn out to be too small you can just add 
more raided space, add that storage to your volume group and then add that 
space to whichever logical volumes need it.

There are lots of caveats of course, does your current OS support 
raided /boot, does your current OS support root LVM, etc.  My experience with 
this is mostly based on Debian Sarge which works great (as of a few months 
ago).

-- 
Fraser Campbell <fraser-Txk5XLRqZ6CsTnJN9+BGXg at public.gmane.org>                 http://www.wehave.net/
Georgetown, Ontario, Canada                               Debian GNU/Linux
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list