public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [gentoo-user]  Re: Resize /
  @ 2006-11-20  7:47 99%     ` Dirk Heinrichs
  0 siblings, 0 replies; 1+ results
From: Dirk Heinrichs @ 2006-11-20  7:47 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 4194 bytes --]

Am Freitag, 17. November 2006 23:30 schrieb ext Dale:

> Somewhat on topic here.  How hard is it to do this with no previous
> knowledge of how it works?  I am constantly running into the same thing
> the OP is and having to move things around.  Currently I have two 80GB
>
> drives.  Here is my partition scheme at the moment:
> > root@smoker / # mount
> > /dev/hda6 on / type reiserfs (rw)
> > /dev/hda1 on /boot type reiserfs (rw,noatime,notail)
> > /dev/hda7 on /home type reiserfs (rw)
> > /dev/hda8 on /usr type reiserfs (rw)
> > /dev/hda9 on /usr/portage type reiserfs (rw)
> > /dev/hda10 on /data type reiserfs (rw)
> > root@smoker / #
> > root@smoker / # df
> > Filesystem           1K-blocks      Used Available Use% Mounted on
> > /dev/hda6              9765136   1896004   7869132  20% /
> > /dev/hda1               146612     45880    100732  32% /boot
> > /dev/hda7              9765136   1236144   8528992  13% /home
> > /dev/hda8              9765136   4269660   5495476  44% /usr
> > /dev/hda9              5859272   3052004   2807268  53% /usr/portage
> > /dev/hda10            43762436  10667796  33094640  25% /data
> > root@smoker / #
>
> Just looking to get a better grasp on this since it sounds like
> something I need to try.

OK, here's my proposal: First, decide which volume management system to use 
(LVM or EVMS). LVM is just one more volume management tool which you would 
have to learn (beside fdisk, mkfs.*, raid tools, ...), while EVMS does it 
all, and more. Then, do the real work:

You mentioned you have two 80G disks, but in the output above I only see one 
in use. If this is really the case, you could start converting to LVM/EVMS 
with the second one (assuming you don't use SW RAID, which I have no 
knowledge of). Emerge LVM or EVMS, depending on your choice, and make sure 
you have CONFIG_BLK_DEV_DM in your kernel. Then either switch to runlevel 1 
or use a LiveCD to do the real work.

1) Create one big partition on the second disk, with type LVM
2) Create a volume group from this partition, choose whatever name you like.
3) Create logical volumes inside this volume group, one for each partition 
you have on hda, except /boot and /, create filesystems on them and mount 
them somewhere. From the values above, you still have /var and /opt inside 
hda6. Create new LV's for these two also.
4) Copy over the data partitionwise, like: cd /home && tar -clf - .|
tar -C /mnt/home -xBpvf -
5) Change fstab accordingly and check RC_VOLUME_ORDER in /etc/conf.d/rc.
6) Rename your old /var and /opt (to /var.save and /opt.save) and recreate 
them as empty directories (you will mount the new LV's there).
7) Since you didn't touch /boot and /, you should now be able to boot with 
working LVM/EVMS setup. If this is the case, we can now do some changes on 
hda.
8) You will need to boot a LiveCD now, for shrinking hda6 to a reasonable 
amount (256M).
9) Create a (temporary) LV, create a filesystem, mount it somewhere and use 
tar as above to copy over / to the new filesystem.
10) Repartition hda: Delete all partitions except hda1 (/boot). Create 2 new 
ones, hda2 (/, 256M) and hda3 (rest of the disk, type LVM), make a 
filesystem on hda2 and mount it.
11) Delete the old (renamed) /var.save and /opt.save from the temporary copy 
of /, then use tar again to copy your / back to hda1.
12) Add hda3 to the already existing volume group.
13) (Optional) You could now move all logical volumes to hda3 and afterwards 
delete hdb1 from the volume group. This would enable you to setup SW RAID 1 
(Mirroring) in the future. If you want to use all 160G, keep it as it is.
14) reboot, without LiveCD. Hopefully your system should be up and running 
now.
15) Delete the temporary LV from step 9).


Enjoy your new flexibility.

Bye...

	Dirk
-- 
Dirk Heinrichs          | Tel:  +49 (0)162 234 3408
Configuration Manager   | Fax:  +49 (0)211 47068 111
Capgemini Deutschland   | Mail: dirk.heinrichs@capgemini.com
Hambornerstraße 55      | Web:  http://www.capgemini.com
D-40472 Düsseldorf      | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2006-11-16 17:55     [gentoo-user] Resize / jakommo
2006-11-17 19:43     ` [gentoo-user] " Alexander Skwar
2006-11-17 22:30       ` Dale
2006-11-20  7:47 99%     ` Dirk Heinrichs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox