Carl Lowenstein wrote:
On 6/3/07, Carl Lowenstein <[EMAIL PROTECTED]> wrote:
On 6/3/07, Ralph Shumaker <[EMAIL PROTECTED]> wrote:
> I got an install DVD for FC7 (thanks Carl).
>
> I read the release notes.
>
> I proceeded to the disk setup portion. I could not figure out how to
> get it to shrink my current FC4 system so that I can dual boot between
> the two (and go ahead and set up FC7 on Xen, but that's a non-issue at
> the moment).
>
> How can I use this to shrink existing partions and LVs (and the file
> systems therein contained)?
>
> So I rebooted back into FC4.
>
> $ df
> Filesystem 1K-blocks Used Available Use% Mounted on
> /dev/mapper/VolGroup00-Slash
> 130583936 5536780 118306780 5% /
> /dev/hda2 101105 31345 64539 33% /boot
> /dev/shm 225240 0 225240 0% /dev/shm
> /dev/mapper/VolGroup00-Home
> 14728208 1401636 12566356 11% /home
> /dev/hda1 4088532 807304 3281228 20% /mnt/whineDoze
>
> As you can see, I have oodles of space. (Even /boot (the fullest
> partition) could be shrunk if I were that desparate.)
>
> I rarely, if ever, touch whineDoze. I keep it for support issues, but
> I'd be happy to reclaim 2G of that space.
>
The coward's way out is to get another disk drive, copy everything you
want to keep to it, and then completely redo the structure of the
original drive. Alternatively, get another disk drive, set it up the
way you want it and install the OS of your choice, and then copy
everything you want to keep from the old drive to the new one.
There are ways to shrink file systems, I went through this at a KPLUG
meeting presentation once, but will have to go back and look at my
notes. Wait a bit while I get organized. You generally can't shrink
a mounted file system, so you have to be running from a RAMdisk while
shrinking the Root partition. Boot FC4 into rescue mode and carry on
from there. Read a lot about LVM and all of its associated tools.
Some more thoughts, coupled with reading of my old notes. The
LVM-related tools in FC4 may not be all there. But you can use tools
from FC6 or F7. The best way is to boot from the distribution disk
into rescue mode. When you are asked for options, do not mount the
existing system, and do not enable networking.
I made my first attempt to follow this outline from the fc7 install dvd,
then from the knoppixV5.1.1 dvd, then finally from the fc4 install dvd.
At the shell prompt # lvm # this gets you an lvm prompt
This did nothing in the fc7 install dvd except give me a new command
prompt (dead end for that path). Through knoppix and fc4, this gave me
the lvm> prompt.
lvm> vgscan # scan volume groups to see what's
there
lvm> vgdisplay /dev/VolGroup00/Slash # look in detail at the
logical volume
This gives:
Invalid volume group name: VolGroup00/Slash
lvm> vgdiplay
--- Volume Group ---
[snip]
lvm> lvdisplay /dev/VolGroup00/Slash
(displays info about VolGroup00/Slash)
^C # return to shell prompt, we
will shrink the root partition
^C works in Knoppix. In fc4, ^C does absolutely nothing. I had to use
^D in fc4.
# e2fsck -f /dev/VolGroup00/Slash # force fsck
e2fsck: No such file or directory while trying to open /dev/VolGroup00/Slash
(Dead end in both Knoppix *and* fc4.)
That was as far as I was able to get.
# resize2fs -p /dev/VolGroup00/Slash 8G # 640k should be enough
for anybody :-)
# lvm
lvm> lvresize --size 8G /dev/VolGroup00/Slash # resize the logical
volume to fit
lvm> vgdisplay /dev/VolGroup00 # now see what you
have, in some detail
# look for Free PE which
will tell you available space
lvm> lvcreate --size 100G /dev/VolGroup00/New # or whatever size you
want
^C
# mkfs.ext3 /dev/VolGroup00/New
Eventually ^D to leave rescue mode. Note that everything done here
after shrinking the root partition could be done from the normally
booted system, if you wished. Taking care to umount(1) partitions
before working on them.
Of course you could shrink /dev/VolGroup00/Home also, before creating
new volumes.
Oh, yes, if you want to use up all available space, look for the
number reported as Free PE and use that in the lvcreate command
instead of specifying a size in GB:
lvm> lvcreate --extents <Free PE> /dev/VolGroup00/New
Hope this helps, and I think it is all correct.
Note that as a possible confusion, df(1) reports the name of a volume as
/dev/mapper/VolGroup00-Slash
but the lvm tools refer to it as
/dev/VolGroup00/Slash
carl
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list