Mailinglist Archive: opensuse (2035 mails)
| < Previous | Next > |
Re: [opensuse] Questions for Partitioning guru's
- From: Peter Sjoberg <peters-opensuse@xxxxxxxxxx>
- Date: Fri, 14 Sep 2007 00:06:09 -0400
- Message-id: <1189742771.5163.77.camel@xxxxxxxxxxxxxxxxxxxxxxx>
On Thu, 2007-09-13 at 00:47 -0400, Bob S wrote:
> ..........<snipped a bunch>...........
>
> I am interested/concerned about LVM and have a few questions for you.
> >
> > Besides what the other posts said I didn't see anyone with a setup
> > similar to mine.
> > I'm using 3 disk (was using 5 for a while, 3 ide & 2 sata) and at my
> > peak I had MS Win, opensuse 10.0, 10.1, suse desktop beta and 2 versions
> > Mandrake installed.
> >
> > You could do something like:
> >
> > disk1p1 M$ Win
> > disk1p2 /boot # 200Mb common boot for everyone
> > disk1p3 swap # swap common to everyone
>
> OK those first 3 are primary partitions, correct? I understand the concept of
> the swap for all OS's /boot for everyone?
Correct
>
> > disk1p5 / # everyday Linux 1 (one you can fall back to)
> > disk1p6 / # everyday Linux 2 (one you plan to move to)
> > disk1p8 LVM
> > disk2p1 LVM
> > disk3p1 LVM
>
> Now these are logical on an extended partition right? P5 & 6 are "regular"
> e.g. ext3, whatever. The rest of disk one becomes LVM and you put LVM on the
> remaining disks.
yes. I keep around enough non-lvm stuff to be able to run single user
mod somewhere but that's about it.
> >
> > LVM: collection of all partitions marked LVM (=all disks become one huge
> > virtual disk)
>
> Right, now when I installed 10.0 I used LVM. It was fine. When I went to
> install 10.2 I was going to use LVM again but when I saw that it was going to
> combine the new volumes with the old ones it frightened me and I backed out
> used the standard partitioning scheme. Now,since you seem to have everything
> mixed together, how do you uninstall anything?
lvremove /dev/vg/s102lv
lvremove /dev/vg/s102varlv
lvremove /dev/vg/s102usrlv
> It must be a mess. And how
> about naming volumes, they all have to be unique no?
> So what does /etc
> or /var or whatever become when you install. Or do you just make disk1p5 and
> disk1p6 large enough to hold everything? And what about ubuntuor fedora or
> whatever. They all have /home, /var, etc. etc.
If you think about it, it's not that much different then when using
plain partitions. When you have one disk you are forced to call every
partition sda1, sda2 and so on up to sda15. If you now install 4
different os versions, how do you keep track of what partition that
is /var for each os?
With lvm you have the flexibility to name each "partition" something
more meaningful so where you now have "sda13" you can name it
"s103b3varlv".
>
> > homelv # common home dir for all installs (see note above)
> > datalv # common data like install packages, mp3, movies etc
> > NLDlv # root partition for NLD testing
> > SLESlv # root partition for SLES testing
> > fclv # root partition for fedora testing
>
> A common /home? for everything?
You could but may need to keep the users separated so you don't get
config files mixed up.
I have /home common between everything inlcuding M$ win but that's done
by NFS/samba fs on a separate server (which also runs ldap for accounts)
so I need to keep track of what user I have for different distro tests.
What I end up doing is that for my "stable" day2day use I use my nfs
home and when I want to test some other distro I create a small /home
for that distro (many times left on / since I don't put anything of
value in my test env).
> I can see a common /data because that is all
> it is. And then is accesible from anything you have installed. Good.
> >
<SNIP>
> > and you can even add a new disk and expand it
> > without problem. If I need to replace a disk with a bigger one/remove
> > one I can use a single "pvmove /dev/hdb" to move data around and get it
> > done without tons of repartition and fs moves.
>
> Yes, but I found it to be confusing when I went to install 10.2
Besides all the other lvm doc on google it's a presentation of lvm at
http://www.techwiz.ca/~peters/presentations/lvm/ . It's a little old in
that it was done before online resizing of ext3 was available but it
tries to explain the basics of filesystems and lvm and that is still
valid. The .sxi has a few notes added also so enable "notes" view.
Yes, like everything it's confusing until you understand it.
In simple terms you can say that you collect all available disk space
you have ("LVM" above), concatenate them back to back and call that
"vg01".
#put a lvm signature on the partitions
pvcreate /dev/sda8 /dev/sdb1
#create a new volume group
vgcreate vg01 /dev/sda8 /dev/sdb1
After that you can almost treat that as one big disk but instead of
using fdisk/cfdisk/yast partitioner/sfdisk to create partitions you use
"lvcreate" (or yast partitioner) .
lvcreate --size 10G --name datalv vg01 # creates 10G /dev/vg01/datalv
mkfs /dev/vg01/datalv
mount /dev/vg01/datalv /data
As you see it's not that different from plain disk partitions. What
happens under the hood is that if the first disk only have 2G free it
will allocate the rest from the second disk and this without you even
knowing about it.
If you run out of space on /data you can then
lvextend --size +10G /dev/vg01/datalv
resize2fs /dev/vg01/datalv
And move on with life with a 20G /data
If you completely run out of diskspace and decide to add another disk
pvcreate /dev/sdc1
vgextend vg01 /dev/sdc1
And then the new disk is added to the pool of free space.
> >
> > One thing is that since /boot and /boot/grub/menu.lst is common for all
> > installs you need to manually manage that area. I found that each os
> > version have there own version numbering like
> > vmlinuz-2.6.18.8-0.5-default/initrd-2.6.18.8-0.5-default so there is no
> > conflict but they normally replace /boot/grub/menu.lst so I make sure I
> > have a copy of menu.lst somewhere and then I manually merge the old and
> > new menu.lst after each install.
>
> That sounds like a smart idea. Would have saved me some heartache after I
> installed 10.2
>
> Let me tell you what happened to me. After the 10.2 install both of the OS's
> were working fine. When I upgraded the kernel in 10.2 with Yast it replaced
> the old kernel and broke 10.0.
> >
> One last question; how big do you normally make the regular partitions andthe
> volumes? And I assume you do not leave any unused space, and must you assign
> it all?
At home I have a mixed environment with a central nfs server where I
store most of my stuff but when I build systems what I go with is
/boot, 100Mb, hd partition
only created when I have raid1 or multiboot. If I just install one os I
don't create /boot at all.
/ 10G, hd partition
I wan't it to be big enough to hold base os including /usr but not /var.
I don't really want the whole /usr but /usr/bin, /usr/sbin & /usr/lib
are good to have when you need to recover from problems. If / fills up
parts (like /usr/share) or the whole of /usr can be moved to lvm.
LVM, Rest of disk
/tmp, 1/2 ram(default), ramdisk (tmpfs)
/var, 2G, LVM
The size depends a lot on what I'm going to use the system for, but I
want it away from / since it contains
swap, =Phys ram, LVM
This can as well a flat file and the size depends on total ram and you
have lots of schools for the formula. 2xRAM was good when you had 4Mb
but today you migth have 64G in a system and then you would almost never
use swap and definitly not several G of swap. I put =Phys ram since I
use ram/swap for /tmp and my systems are between 512Mb and 6G.
/home, /data, /...
All on lvm but the size depends on system usage.
"must assign all", I do assign all hard disk space to something but I do
not use up all my lvm space directly. That way I can expand the
partition I made to small later without first shrinking something
(shrinking is possible but it is a pain to do).
>
> Bob S.
/ps
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
> ..........<snipped a bunch>...........
>
> I am interested/concerned about LVM and have a few questions for you.
> >
> > Besides what the other posts said I didn't see anyone with a setup
> > similar to mine.
> > I'm using 3 disk (was using 5 for a while, 3 ide & 2 sata) and at my
> > peak I had MS Win, opensuse 10.0, 10.1, suse desktop beta and 2 versions
> > Mandrake installed.
> >
> > You could do something like:
> >
> > disk1p1 M$ Win
> > disk1p2 /boot # 200Mb common boot for everyone
> > disk1p3 swap # swap common to everyone
>
> OK those first 3 are primary partitions, correct? I understand the concept of
> the swap for all OS's /boot for everyone?
Correct
>
> > disk1p5 / # everyday Linux 1 (one you can fall back to)
> > disk1p6 / # everyday Linux 2 (one you plan to move to)
> > disk1p8 LVM
> > disk2p1 LVM
> > disk3p1 LVM
>
> Now these are logical on an extended partition right? P5 & 6 are "regular"
> e.g. ext3, whatever. The rest of disk one becomes LVM and you put LVM on the
> remaining disks.
yes. I keep around enough non-lvm stuff to be able to run single user
mod somewhere but that's about it.
> >
> > LVM: collection of all partitions marked LVM (=all disks become one huge
> > virtual disk)
>
> Right, now when I installed 10.0 I used LVM. It was fine. When I went to
> install 10.2 I was going to use LVM again but when I saw that it was going to
> combine the new volumes with the old ones it frightened me and I backed out
> used the standard partitioning scheme. Now,since you seem to have everything
> mixed together, how do you uninstall anything?
lvremove /dev/vg/s102lv
lvremove /dev/vg/s102varlv
lvremove /dev/vg/s102usrlv
> It must be a mess. And how
> about naming volumes, they all have to be unique no?
> So what does /etc
> or /var or whatever become when you install. Or do you just make disk1p5 and
> disk1p6 large enough to hold everything? And what about ubuntuor fedora or
> whatever. They all have /home, /var, etc. etc.
If you think about it, it's not that much different then when using
plain partitions. When you have one disk you are forced to call every
partition sda1, sda2 and so on up to sda15. If you now install 4
different os versions, how do you keep track of what partition that
is /var for each os?
With lvm you have the flexibility to name each "partition" something
more meaningful so where you now have "sda13" you can name it
"s103b3varlv".
>
> > homelv # common home dir for all installs (see note above)
> > datalv # common data like install packages, mp3, movies etc
> > NLDlv # root partition for NLD testing
> > SLESlv # root partition for SLES testing
> > fclv # root partition for fedora testing
>
> A common /home? for everything?
You could but may need to keep the users separated so you don't get
config files mixed up.
I have /home common between everything inlcuding M$ win but that's done
by NFS/samba fs on a separate server (which also runs ldap for accounts)
so I need to keep track of what user I have for different distro tests.
What I end up doing is that for my "stable" day2day use I use my nfs
home and when I want to test some other distro I create a small /home
for that distro (many times left on / since I don't put anything of
value in my test env).
> I can see a common /data because that is all
> it is. And then is accesible from anything you have installed. Good.
> >
<SNIP>
> > and you can even add a new disk and expand it
> > without problem. If I need to replace a disk with a bigger one/remove
> > one I can use a single "pvmove /dev/hdb" to move data around and get it
> > done without tons of repartition and fs moves.
>
> Yes, but I found it to be confusing when I went to install 10.2
Besides all the other lvm doc on google it's a presentation of lvm at
http://www.techwiz.ca/~peters/presentations/lvm/ . It's a little old in
that it was done before online resizing of ext3 was available but it
tries to explain the basics of filesystems and lvm and that is still
valid. The .sxi has a few notes added also so enable "notes" view.
Yes, like everything it's confusing until you understand it.
In simple terms you can say that you collect all available disk space
you have ("LVM" above), concatenate them back to back and call that
"vg01".
#put a lvm signature on the partitions
pvcreate /dev/sda8 /dev/sdb1
#create a new volume group
vgcreate vg01 /dev/sda8 /dev/sdb1
After that you can almost treat that as one big disk but instead of
using fdisk/cfdisk/yast partitioner/sfdisk to create partitions you use
"lvcreate" (or yast partitioner) .
lvcreate --size 10G --name datalv vg01 # creates 10G /dev/vg01/datalv
mkfs /dev/vg01/datalv
mount /dev/vg01/datalv /data
As you see it's not that different from plain disk partitions. What
happens under the hood is that if the first disk only have 2G free it
will allocate the rest from the second disk and this without you even
knowing about it.
If you run out of space on /data you can then
lvextend --size +10G /dev/vg01/datalv
resize2fs /dev/vg01/datalv
And move on with life with a 20G /data
If you completely run out of diskspace and decide to add another disk
pvcreate /dev/sdc1
vgextend vg01 /dev/sdc1
And then the new disk is added to the pool of free space.
> >
> > One thing is that since /boot and /boot/grub/menu.lst is common for all
> > installs you need to manually manage that area. I found that each os
> > version have there own version numbering like
> > vmlinuz-2.6.18.8-0.5-default/initrd-2.6.18.8-0.5-default so there is no
> > conflict but they normally replace /boot/grub/menu.lst so I make sure I
> > have a copy of menu.lst somewhere and then I manually merge the old and
> > new menu.lst after each install.
>
> That sounds like a smart idea. Would have saved me some heartache after I
> installed 10.2
>
> Let me tell you what happened to me. After the 10.2 install both of the OS's
> were working fine. When I upgraded the kernel in 10.2 with Yast it replaced
> the old kernel and broke 10.0.
> >
> One last question; how big do you normally make the regular partitions andthe
> volumes? And I assume you do not leave any unused space, and must you assign
> it all?
At home I have a mixed environment with a central nfs server where I
store most of my stuff but when I build systems what I go with is
/boot, 100Mb, hd partition
only created when I have raid1 or multiboot. If I just install one os I
don't create /boot at all.
/ 10G, hd partition
I wan't it to be big enough to hold base os including /usr but not /var.
I don't really want the whole /usr but /usr/bin, /usr/sbin & /usr/lib
are good to have when you need to recover from problems. If / fills up
parts (like /usr/share) or the whole of /usr can be moved to lvm.
LVM, Rest of disk
/tmp, 1/2 ram(default), ramdisk (tmpfs)
/var, 2G, LVM
The size depends a lot on what I'm going to use the system for, but I
want it away from / since it contains
swap, =Phys ram, LVM
This can as well a flat file and the size depends on total ram and you
have lots of schools for the formula. 2xRAM was good when you had 4Mb
but today you migth have 64G in a system and then you would almost never
use swap and definitly not several G of swap. I put =Phys ram since I
use ram/swap for /tmp and my systems are between 512Mb and 6G.
/home, /data, /...
All on lvm but the size depends on system usage.
"must assign all", I do assign all hard disk space to something but I do
not use up all my lvm space directly. That way I can expand the
partition I made to small later without first shrinking something
(shrinking is possible but it is a pain to do).
>
> Bob S.
/ps
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |