Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Disk upgrade sanity check pls (http://www.linux-archive.org/gentoo-user/84186-disk-upgrade-sanity-check-pls.html)

Adam Carter 05-08-2008 06:20 AM

Disk upgrade sanity check pls
 
I'm running
out of disk space on my laptop and the new disk arrived today.

*
Old*setup; 60 gig drive;
/dev/hda1 = /home (used to be
windows, hence the partition
number)
/dev/hda2 = swap
/dev/hda3 = /
*
New setup; 250 gig drive
/dev/hda1 = /
(including /home)
/dev/hda2 = swap
*
Here's my plan;
- make a new lilo.conf entry to boot off /dev/hda1,
then run 'lilo -v'
- boot knoppix
- dump /dev/hda3 (/) to USB external
drive with 'mount /dev/hda3 /mnt/root ; rsync -a /mnt/root
/usbdrive/'
-*dump /dev/hda1
(/home)*to USB drive*with 'mount /dev/hda1 /mnt/home ; rsync -a
/mnt/home /usbdrive/'
- dump MBR to USB drive with 'dd if=/dev/hda
of=/usbdrive/mbr_backup bs=512 count=1'
*
- power
down, swap hda to new drive, boot knoppix again
- add boot record without
partition table, 'dd if=/whatever/mbr_backup of=/dev/hda bs=446 count=1'
-
'fdisk /dev/hda', create one linux partition using most of the disk and one
linux swap partition
- put filesystem on /dev/hda1 with 'mkreiserfs
/dev/hda1'
- dump old / to /dev/hda1 with 'mount /dev/hda1 /mnt/root ; rsync
-a /usbdrive/root/* /mnt/root'
- dump old /home onto /dev/hda1 with 'rsync -a
/usbdrive/home /mnt/root'
- create swap 'mkswap
/dev/hda2'
*
then reboot and use*the new lilo entry that points to /dev/hda1.
*
Will it
work?
*
tnx

"Wang, Baojun" 05-08-2008 06:42 AM

Disk upgrade sanity check pls
 
hi,

I think it's better to use LVM to manage your partitions, it will be
much less painful..

Wang
在 2008-05-08四的 16:20 +1000,Adam Carter写道:
> I'm running out of disk space on my laptop and the new disk arrived
> today.
>
> Old setup; 60 gig drive;
> /dev/hda1 = /home (used to be windows, hence the partition number)
> /dev/hda2 = swap
> /dev/hda3 = /
>
> New setup; 250 gig drive
> /dev/hda1 = / (including /home)
> /dev/hda2 = swap
>
> Here's my plan;
> - make a new lilo.conf entry to boot off /dev/hda1, then run 'lilo -v'
> - boot knoppix
> - dump /dev/hda3 (/) to USB external drive with
> 'mount /dev/hda3 /mnt/root ; rsync -a /mnt/root /usbdrive/'
> - dump /dev/hda1 (/home) to USB drive with
> 'mount /dev/hda1 /mnt/home ; rsync -a /mnt/home /usbdrive/'
> - dump MBR to USB drive with 'dd if=/dev/hda of=/usbdrive/mbr_backup
> bs=512 count=1'
>
> - power down, swap hda to new drive, boot knoppix again
> - add boot record without partition table, 'dd if=/whatever/mbr_backup
> of=/dev/hda bs=446 count=1'
> - 'fdisk /dev/hda', create one linux partition using most of the disk
> and one linux swap partition
> - put filesystem on /dev/hda1 with 'mkreiserfs /dev/hda1'
> - dump old / to /dev/hda1 with 'mount /dev/hda1 /mnt/root ; rsync
> -a /usbdrive/root/* /mnt/root'
> - dump old /home onto /dev/hda1 with 'rsync
> -a /usbdrive/home /mnt/root'
> - create swap 'mkswap /dev/hda2'
>
> then reboot and use the new lilo entry that points to /dev/hda1.
>
> Will it work?
>
> tnx
>
>
--
Wang, Baojun Lanzhou University
Distributed & Embedded System Lab http://dslab.lzu.edu.cn
School of Information Science and Engeneering wangbj@dslab.lzu.edu.cn
Tianshui South Road 222. Lanzhou 730000 .P.R.China
Tel: +86-931-8912025 Fax: +86-931-8912022

Dirk Heinrichs 05-08-2008 08:03 AM

Disk upgrade sanity check pls
 
Am Donnerstag, 8. Mai 2008 schrieb ext Adam Carter:
> I'm running out of disk space on my laptop and the new disk arrived
> today.
>
> Old setup; 60 gig drive;
> /dev/hda1 = /home (used to be windows, hence the partition number)
> /dev/hda2 = swap
> /dev/hda3 = /
>
> New setup; 250 gig drive
> /dev/hda1 = / (including /home)
> /dev/hda2 = swap

Hmm, I don't like those all-in-one-partition setups. But as always: YMMV.
However, since this is a laptop, I would recommend encrypting the
partitions. But that would mean to use a separate /boot and booting the
system from an initramfs (needed to unlock the real / partition). The setup
would be like this:

hda1: /boot (32M, ext2)
hda2: swap
hda3: / (rest of disk)

However, I would use a different setup on my systems:

hda1: /boot (32M, ext2)
hda2: LVM, rest of disk.

Then put everything into small (as possible) logical volumes.

> Here's my plan;
> - make a new lilo.conf entry to boot off /dev/hda1, then run 'lilo -v'

I wonder why people still use lilo.

> - boot knoppix
> - dump /dev/hda3 (/) to USB external drive with 'mount /dev/hda3
> /mnt/root ; rsync -a /mnt/root /usbdrive/' - dump /dev/hda1 (/home) to
> USB drive with 'mount /dev/hda1 /mnt/home ; rsync -a /mnt/home
> /usbdrive/' - dump MBR to USB drive with 'dd if=/dev/hda
> of=/usbdrive/mbr_backup bs=512 count=1'
> - power down, swap hda to new drive, boot knoppix again
> - add boot record without partition table, 'dd if=/whatever/mbr_backup
> of=/dev/hda bs=446 count=1' - 'fdisk /dev/hda', create one linux

I wouldn't write the mbr from the old drive to the new one. Just let lilo
write a new mbr to the new drive.

> partition using most of the disk and one linux swap partition - put
> filesystem on /dev/hda1 with 'mkreiserfs /dev/hda1'
> - dump old / to /dev/hda1 with 'mount /dev/hda1 /mnt/root ; rsync -a
> /usbdrive/root/* /mnt/root' - dump old /home onto /dev/hda1 with 'rsync
> -a /usbdrive/home /mnt/root' - create swap 'mkswap /dev/hda2'
>
> then reboot and use the new lilo entry that points to /dev/hda1.
>
> Will it work?

Yes, looks good.

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
Wanheimerstrae 68 | Web: http://www.capgemini.com
D-40468 Dsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net


All times are GMT. The time now is 07:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.