LISTSERV mailing list manager LISTSERV 16.0

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


LINUX-L@LISTS.UFL.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

LINUX-L Home

LINUX-L Home

LINUX-L  2007

LINUX-L 2007

Subject:

Re: Switching partitions...

From:

Jon Lewis <[log in to unmask]>

Reply-To:

Platform Independent Linux List! <[log in to unmask]>

Date:

Fri, 2 Nov 2007 21:07:08 -0400

Content-Type:

TEXT/PLAIN

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (47 lines)

On Fri, 2 Nov 2007, Jeff Lasman wrote:

> I've got this partition setup on a CentOS 4 install:
>
> <snip>
> $ df -h
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/md0              981M  146M  785M  16% /
> none                  502M     0  502M   0% /dev/shm
> /dev/md3              2.0G  188M  1.7G  10% /home
> /dev/md2              2.0G   36M  1.9G   2% /tmp
> /dev/md1              9.9G  716M  8.7G   8% /usr
> /dev/md5               42G  532M   40G   2% /var
> [jlasman@ustxd02 ~]$
> </snip>
>
> But I'd like a foolproof way to swap the /home and the /var partitions.
> Should I risk this?

Why?  2gb is kind of small for /var.  If you need more /home space, you 
could just create /var/home and use symlinks to either make /home point 
into /var/home, or point individual /home/ subdirs into /var/home/.

If you really want to do this, ssh in, cd /, be root, kill everything that 
uses /home or /var (fuser may be helpful if they're not obvious), mkdir 
/usr/var, mkdir /usr/home, cp -ar /home/* /usr/home/, cp -ar /var/* 
/usr/var/, rm -rf /home/*, rm -rf /var/*, cp -ar /usr/home/* /var/, cp -ar 
/usr/var/* /home, umount /home, umount /var, edit fstab, mount /home, 
mount /var.  You should probably remove and re-mklost+found in each of the 
swapped partitions when you're done.

I make no guarantees about this being foolproof (given the right fool, 
nothing is), but I've done this sort of thing before.  It's really not 
complicated...just a bunch of simple steps.

> (I can easily afford downtime of up to a day, but of course the shorter
> the better; it's one of our slave nameservers.)

A day?  Hell, with the amount of data on that box, you could swap out the 
drives for new ones, boot from a live CD, and restore from backups during 
lunch.

----------------------------------------------------------------------
  Jon Lewis                   |  I route
  Senior Network Engineer     |  therefore you are
  Atlantic Net                |
_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997

ATOM RSS1 RSS2



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager