1 |
Pandu Poluan writes: |
2 |
|
3 |
> Everytime I read some guide on LVM, my eyes becomes blurry, the room |
4 |
> starts spinning, and I can hear wolves howling ... :D |
5 |
> |
6 |
> Seriously, LVM looks mighty nice, but it also looks (and is!) mighty |
7 |
> complex. |
8 |
|
9 |
I really don't think so. pvcreate <partition> creates a physical volume, |
10 |
vgcreate <vgname> <partition> starts a volume group, and lvcreate -n |
11 |
<name> -L <size> <vgname> creates a logical volume that you can use as |
12 |
if it were a physical partition. |
13 |
|
14 |
pvcreate /dev/sda5 |
15 |
vgcreate myvg /dev/sda5 |
16 |
lvcreate -n usr -L 10G myvg |
17 |
mke2fs -j /dev/myvg/usr |
18 |
|
19 |
> So, I want to start from something simple. |
20 |
|
21 |
Of course, just using /dev/sda5 for /usr is simpler. But what if this |
22 |
turns out to be too small? With so many partitions I would think this is |
23 |
very likely to happen sooner or later. With LVM, all you'd have to do is: |
24 |
|
25 |
lvresize -L +1G /dev/myvg/usr |
26 |
resize2fs /dev/myvg/usr |
27 |
|
28 |
Takes 10 seconds plus the time you need to type this, and you have 1G of |
29 |
more space. Otherwise, you'd probably have to boot from another system |
30 |
and use something like parted to move stuff around. Or move stuff like |
31 |
/usr/src to other partitions. |
32 |
|
33 |
Another neat featurea are snapshots, this is nice for backups. |
34 |
|
35 |
|
36 |
> Comments, suggestions, are welcome :) |
37 |
|
38 |
I also have many partitons, but I've overdone italready. |
39 |
|
40 |
I like to have all big partitions separated in order to prevent / from |
41 |
becoming full, so I have /home, /opt, /tmp, /usr and /var. I also have |
42 |
/usr/{local,src}. And a big partition for /var/portage, contining tree |
43 |
(sometimes on its own partition), distfiles and tmpdir. And /home. And |
44 |
/data/{mp3,mpeg}. And /32 for my 32 bit chroot Gentoo. And /backup for |
45 |
all sorts of backups, including a sub-directory with another partiton |
46 |
for each of the partitions above. All are LUKS-encrypted, and it takes a |
47 |
while during bootup until they are all opened. But then, I reboot very |
48 |
seldomly. |
49 |
|
50 |
Wonko |