1 |
Dirk Heinrichs wrote: |
2 |
> Am Freitag, 17. November 2006 23:30 schrieb ext Dale: |
3 |
> |
4 |
> |
5 |
>> Somewhat on topic here. How hard is it to do this with no previous |
6 |
>> knowledge of how it works? I am constantly running into the same thing |
7 |
>> the OP is and having to move things around. Currently I have two 80GB |
8 |
>> |
9 |
>> drives. Here is my partition scheme at the moment: |
10 |
>> |
11 |
>>> root@smoker / # mount |
12 |
>>> /dev/hda6 on / type reiserfs (rw) |
13 |
>>> /dev/hda1 on /boot type reiserfs (rw,noatime,notail) |
14 |
>>> /dev/hda7 on /home type reiserfs (rw) |
15 |
>>> /dev/hda8 on /usr type reiserfs (rw) |
16 |
>>> /dev/hda9 on /usr/portage type reiserfs (rw) |
17 |
>>> /dev/hda10 on /data type reiserfs (rw) |
18 |
>>> root@smoker / # |
19 |
>>> root@smoker / # df |
20 |
>>> Filesystem 1K-blocks Used Available Use% Mounted on |
21 |
>>> /dev/hda6 9765136 1896004 7869132 20% / |
22 |
>>> /dev/hda1 146612 45880 100732 32% /boot |
23 |
>>> /dev/hda7 9765136 1236144 8528992 13% /home |
24 |
>>> /dev/hda8 9765136 4269660 5495476 44% /usr |
25 |
>>> /dev/hda9 5859272 3052004 2807268 53% /usr/portage |
26 |
>>> /dev/hda10 43762436 10667796 33094640 25% /data |
27 |
>>> root@smoker / # |
28 |
>>> |
29 |
>> Just looking to get a better grasp on this since it sounds like |
30 |
>> something I need to try. |
31 |
>> |
32 |
> |
33 |
> OK, here's my proposal: First, decide which volume management system to use |
34 |
> (LVM or EVMS). LVM is just one more volume management tool which you would |
35 |
> have to learn (beside fdisk, mkfs.*, raid tools, ...), while EVMS does it |
36 |
> all, and more. Then, do the real work: |
37 |
> |
38 |
|
39 |
Which one is better and good for someone new to this? I'm fairly |
40 |
descent at Linux. Just thought I would warn you I am not a guru, yet. |
41 |
;-) I'm working on it though. |
42 |
> You mentioned you have two 80G disks, but in the output above I only see one |
43 |
> in use. If this is really the case, you could start converting to LVM/EVMS |
44 |
> with the second one (assuming you don't use SW RAID, which I have no |
45 |
> knowledge of). Emerge LVM or EVMS, depending on your choice, and make sure |
46 |
> you have CONFIG_BLK_DEV_DM in your kernel. Then either switch to runlevel 1 |
47 |
> or use a LiveCD to do the real work. |
48 |
> |
49 |
|
50 |
I do have two 80GB drives. One is a Maxtor and one is a Western |
51 |
Digital. The Maxtor is faster since it has more cache. It is hda and |
52 |
the one I boot off of. I use the other to back up on before a major |
53 |
upgrade, like gcc or something that can really screw things up. Even |
54 |
did it once before a --depclean too. Never needed it but I had it if I |
55 |
did. I usually boot the Gentoo CD and mount the partitions and just do |
56 |
a cp -av and let it roll by. I never could master that tar thing others |
57 |
use. |
58 |
> 1) Create one big partition on the second disk, with type LVM |
59 |
> 2) Create a volume group from this partition, choose whatever name you like. |
60 |
> 3) Create logical volumes inside this volume group, one for each partition |
61 |
> you have on hda, except /boot and /, create filesystems on them and mount |
62 |
> them somewhere. From the values above, you still have /var and /opt inside |
63 |
> hda6. Create new LV's for these two also. |
64 |
> 4) Copy over the data partitionwise, like: cd /home && tar -clf - .| |
65 |
> tar -C /mnt/home -xBpvf - |
66 |
> 5) Change fstab accordingly and check RC_VOLUME_ORDER in /etc/conf.d/rc. |
67 |
> 6) Rename your old /var and /opt (to /var.save and /opt.save) and recreate |
68 |
> them as empty directories (you will mount the new LV's there). |
69 |
> 7) Since you didn't touch /boot and /, you should now be able to boot with |
70 |
> working LVM/EVMS setup. If this is the case, we can now do some changes on |
71 |
> hda. |
72 |
> 8) You will need to boot a LiveCD now, for shrinking hda6 to a reasonable |
73 |
> amount (256M). |
74 |
> 9) Create a (temporary) LV, create a filesystem, mount it somewhere and use |
75 |
> tar as above to copy over / to the new filesystem. |
76 |
> 10) Repartition hda: Delete all partitions except hda1 (/boot). Create 2 new |
77 |
> ones, hda2 (/, 256M) and hda3 (rest of the disk, type LVM), make a |
78 |
> filesystem on hda2 and mount it. |
79 |
> 11) Delete the old (renamed) /var.save and /opt.save from the temporary copy |
80 |
> of /, then use tar again to copy your / back to hda1. |
81 |
> 12) Add hda3 to the already existing volume group. |
82 |
> 13) (Optional) You could now move all logical volumes to hda3 and afterwards |
83 |
> delete hdb1 from the volume group. This would enable you to setup SW RAID 1 |
84 |
> (Mirroring) in the future. If you want to use all 160G, keep it as it is. |
85 |
> 14) reboot, without LiveCD. Hopefully your system should be up and running |
86 |
> now. |
87 |
> 15) Delete the temporary LV from step 9). |
88 |
> |
89 |
> |
90 |
> Enjoy your new flexibility. |
91 |
> |
92 |
> Bye... |
93 |
> |
94 |
> Dirk |
95 |
> |
96 |
|
97 |
OK. I did a cfdisk /dev/hdb and I found type "8E Linux LVM" and I |
98 |
assume that it is the one you mentioned. I have not changed anything |
99 |
just yet. I'm just exploring the idea here. So . . I make a boot |
100 |
partition like I normally would, hda1. Then create another partition |
101 |
that is the LVM type, primary or logical or doesn't matter? Is that |
102 |
correct? Is that all I have to do with cfdisk? I assume the rest is |
103 |
done elsewhere. This is the part I am trying to get my head wrapped |
104 |
around. I can't seem to figure out how it gets split up quite yet. |
105 |
Maybe you can "dummy" it down a bit for me? LOL |
106 |
|
107 |
Can I also assume the 2006 Gentoo CD supports this? You also realize |
108 |
this is going to screw up my uptime? It sounds like this may be worth |
109 |
it though. Alexander mentioned a snapshot. Is that like making a |
110 |
backup? Sounds like a windoze restore point or whatever they call that |
111 |
thing. I don't use windoze at all here. I just mess with everybody |
112 |
elses crap. |
113 |
|
114 |
My plan, copy my OS over to hdb, then set up LVM or EVMS on hda and then |
115 |
copy it back. I like my Maxtor since it is faster. All this from the |
116 |
Gentoo CD of course. I'm OK with that Gentoo CD. It only took me about |
117 |
three times to get my install to boot. O_O I plan to eventually use |
118 |
all 160GB of space but the mirror sounds neat too. I'm on dial-up so I |
119 |
can't fill up a hard drive to fast anyway. Sucky 26K. :-( |
120 |
|
121 |
Thanks for the help. Links are welcome. I try to read as much as I can. |
122 |
|
123 |
Dale |
124 |
|
125 |
:-) :-) :-) |