Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] grub and what happens exactly when booting.
Date: Sat, 17 Sep 2011 12:56:50
Message-Id: 20110917145532.23d1a2ef@rohan.example.com
In Reply to: Re: [gentoo-user] grub and what happens exactly when booting. by Dale
1 On Fri, 16 Sep 2011 19:06:40 -0500
2 Dale <rdalek1967@×××××.com> wrote:
3
4 > Neil Bothwick wrote:
5 > > On Fri, 16 Sep 2011 22:03:20 +0100, Peter Humphrey wrote:
6 > >
7 > >> In case it helps, here's the relevant part of my fstab:
8 > >>
9 > >> /dev/sda1 /boot ext2 noatime,noauto 1 2
10 > >> /dev/md3 / ext4 noatime 1 1
11 > >> /dev/vg1/home /home ext4 noatime
12 > >> 1 2
13 > > A word of advice when starting from scratch, give your VG(s) unique
14 > > names. I've seen what happens when someone takes a drive from
15 > > one Fedora system and puts it in another, so there are two VGs
16 > > called vg01. It ain't nice (only one is seen, usually not the one
17 > > you want).
18 > >
19 > > I prefer to give my VGs names related to the hostname, so it's
20 > > perfectly clear where they came from and no risk of name collisions
21 > > if I have to attach the drive to another computer.
22 > >
23 > >
24 >
25 > I did name it pretty well. It is called "test" right now. lol
26 > Right now, I'm just having fun. The biggest difference so far is
27 > that I can see with my new glasses. I just wish I didn't have
28 > arthritis in my neck and could move my head better. It's hard to
29 > switch between normal and the bifocal thingys.
30 >
31 > I'm getting this LVM thing down pat tho.
32 >
33 > cfdisk to create partitions, if not using the whole drive.
34 > pvcreate
35 > vgcreate
36 > lvcreate
37 > then put on a file system and mount.
38 >
39 > I still get them confused as to what comes first but I got some
40 > pictures to look at now. That helps to picture what I am doing, sort
41 > of.
42 >
43 > Thanks to all for the advice tho. It's helping. Still nervous
44 > about / on LVM tho. :/
45
46
47 Your list is upside down :-) Turn it the other way in your head and it
48 all makes sense, fs at the top and pv at the bottom and the order makes
49 sense. A useful mental trick is to remember that each thing in the list
50 can't be bigger than the one below it (you can't put a 200G fs on a
51 100G block device for example). Take the list:
52
53 fs
54 lv
55 vg
56 pv
57 disk partition
58 raw disk
59
60 To make a bigger fs, you need a bigger lv first. You have free space
61 in the vg, so you can just extend the lv into it, then grow the fs
62 (this is conceptually identical to making a disk partition bigger then
63 growing the fs if you don't use LVM).
64
65 To make a smaller fs, reduce the fs first then reduce the lv to match.
66
67 The one slight oddity is making a vg bigger and smaller - a vg isn't
68 like a volume that you can make bigger, it's a *group* of things,
69 specifically pvs. To make a vg bigger, you add pvs to it. To make a vg
70 smaller, you take pvs away (much like enlarging and reducing RAID
71 arrays - you add and remove disks).
72
73 Once you've worked it through it in your head once or twice it all
74 makes sense. Users just gotta spend the 30 minutes doing that first.
75
76
77 --
78 Alan McKinnnon
79 alan.mckinnon@×××××.com