Moving / and swap into LVM

Remi Collet liste at famillecollet.com
Sun Jan 23 09:11:30 UTC 2005


Matthew Saltzman a écrit :
> I have a 40G disk partitioned as follows, with no empty space:
> 
> /dev/hda1 - Mfgr's diagnostics
> /dev/hda2 - WinXP system
> /dev/hda3 - Lunix /boot
> /dev/hda4 - Extended
>     /dev/hda5 - WinXP data
>     /dev/hda6 - LVM physical volume
>     - /home
>     - /opt
>     - /usr
>     - /usr/local
>     /dev/hda7 - FAT32 shared by WinXP and Linux
>     /dev/hda8 - /
>     /dev/hda9 - swap
> 
> I've discovered that space on / is a bit tight, so I'd like to change 
> things around so that I have:
> 
>     /dev/hda6 - LVM physical volume
>     - /home
>     - /opt
>     - /usr
>     - /usr/local
>     - /
>     - swap
>     /dev/hda7 - FAT32
> 
> Is this possible without reinstalling?  If so, how?

I think so (thanks to LVM)

First disable swap space (in fstab and reboot)

Convert /dev/hda9 to pv (pvcreate)
Extend the LVM "volume group" by adding the new PV
	vgextent
Create the new / in the LVM (hope you have enough place)
	lvcreate, mke2fs
Copy file (from old / to new /) from CD rescue
change from old / to new / (edit fstab and grub.conf)
Convert /dev/hda8 to pv (pvcreate)
Extend the LVM "volume group" by adding the new PV (vgextent)
Create a new lv for swap
	lvcreate, mkswap
Enable the new swap space (edit fstab)

But, first of all : make a backup !

You should have
      /dev/hda6 - physical volume
      /dev/hda7 - FAT32
      /dev/hda8 - physical volume
      /dev/hda9 - physical volume
      LVM vg (hda6+kda8+hda9)
      - /home
      - /opt
      - /usr
      - /usr/local
      - /
      - swap

Cordialy, Remi.




More information about the fedora-list mailing list