Allan Gottlieb wrote:
I need to add space to /var (thank you, libreoffice), which is on lvm.
Since my one volume group vg is getting low, I thought this would be a
good time to extend it as well.
Alan (McKinnon) has posted very helpful lvm bits (reprinted below).
Following alan's bottom up creation mandate I believe the idea is
phy disk: /dev/sda my only drive
phy part: fdisk create another partition of type LVM (/dev/sda8)
phy vol: pvcreate /dev/sda8
vol grp: vgextend vg /dev/sda8
log vol: lvextend --size +10G /dev/vg/var
file sys: resize2fs /dev/vg/var
files/dirs: not relevant
Questions
1. Apparently 2.6 (hence 3.x) kernels can expand mounted file systems
(/var is mounted as ext3).
Since I can't unmount /var because it is in use, I guess that, if I
every need to shrink /var, I would need to boot off a CD. Is that
correct?
Back in the day, we had single user mode for this, but I don't see
how to get the equivalent now.
Is it really safe to extend /var (i.e., /dev/vg/var) while mounted
as ext3? It sounds frightening since daemons could start running
and access /var.
2. Since currently /var is entirely from /dev/sda7 (my original lvm
partition) should I use the optional parameter to lvextend to
force the new space for /var to come from there as well?
lv extend --size +10G /dev/sda7
thanks in advance
allan
When I need to do something like this, I do a:
rc single
That stops all the services, including loggers which need /var, and on
my systems, umounts /var as well. I'm assuming you have upgraded to
baselayout2 and openrc. That may not work on the old setups. When you
go to single user mode, it umounts everything except / itself. May want
to recall that if you have notes in your user directory which would not
be mounted. I always put things like that in /root.
As for being safe, I did one of my file systems recently while
downloading a movie. It was being actively written to while it was
being expanded. The movie played fine when it was all done so I guess
it is safe if the file system can be expanded while mounted. Keep in
mind, some can't so check first.
I'd have to read on the rest as I am a bit new to this too. Maybe
someone who knows more will comment on the rest.
Dale
:-) :-)
--
I am only responsible for what I said ... Not for what you understood or how
you interpreted my words!
Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"