Showing posts with label lvm. Show all posts
Showing posts with label lvm. Show all posts

19 May 2010

Clone hard disk

With dd_rescue, this task becomes more easy.
1. boot into a Linux LiveCD, use fdisk -l to identify your hard disks, if /dev/sda is the old one, and /dev/sdb is the new one, go to next step
2. install sys-fs/ddrescue, and clone the disk
ddrescue -v /dev/sda /dev/sdb
this task will complete after 2 hours or less if the old one is 80GB hard disk (in my case)

3. almost finish, remove the old one, boot into the new one, your os should be ok.

4. another task: if new hard drive is bigger than the old one, free space will not be used, you will see it as free space, create new partition and mount it, or resize current partitions.

5. if you're using LVM2 for your system, read this

12 Jul 2009

LVM, add new logical partition to existing LV

Format that partition using mkfs:
[root@home cappuccino]# mkfs.ext4 /dev/sda8

Initialize it

[root@home cappuccino]# pvcreate /dev/sda8
add to existing VG:

[root@home cappuccino]# vgextend vg_home /dev/sda8
use it:
[root@home cappuccino]# lvresize /dev/vg_home/lv_root -L +3.93G
final step: boot into single user mode, and active new space for Logical volume group:

Disqus