LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 04-19-2009, 09:13 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Debian Lenny AMD64
Posts: 501

Rep: Reputation: 32
Moving to a bigger hard disc.


Hello!

I need some help from you :-)

My HD has the following partition scheme (160Gb HD):

Partition 1: Win (NTFS) 70Gb
Partition 2: FAT32 20Gb
Partition 3: Linux Swap 2Gb.
Partition 4: Linux ext3 / 15Gb
Partition 5: Linux ext3 /home 45Gb

After a fdisk -l this is what shows up:

Quote:
/dev/sda1 * 1 8924 71681998+ 7 HPFS/NTFS
/dev/sda2 8925 9185 2096482+ 82 Linux swap / Solaris
/dev/sda3 9186 11735 20482875 83 Linux
/dev/sda4 11736 19457 62026965 5 Extendida
/dev/sda5 11736 14285 20482843+ b W95 FAT32
/dev/sda6 14286 19457 41544058+ 83 Linux
Now, I would like to buy a new and bigger HD (320 or 500Gb). So, my question is:

How could I move my whole HD to the new one without having to reinstall software and being able to resize my partition scheme to make use of the new hard drive capacity?

Is it possible to use something like Norton Ghost or Clonezilla to accomplish this or I have to reinsall everything from scratch?

If so How should I do it? Cloning partition by partition or the entire disc?

The expected result should be my system booting from the new HD the same as it does today (dual boot included).

Was I clear? If not, please let me know.

Thanks in advance for your cooperation,
Glore2002.-
 
Old 04-19-2009, 10:06 PM   #2
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,263

Rep: Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562Reputation: 562
You could simply use the tar command or cp -a to copy the files.

For example: suppose you create a 45 GB partition for /usr, and mount it temporarily on /mnt/usr, and you create a 150GB partition for home and mount it on /mnt/home.
tar -C / cf - /usr /home /var /bin /sbin /boot /etc /lib /lib64 | tar -C /mnt -xf -
The system directories that have partition will be filled in their respective filesystems. The system directories that aren't mountpoint will have directories created in their place.

The /usr & /home partitions will be the largest. The /usr partition will grow as you install new packages. Having dedicated partitions for /home as you have done already would make sense. A separate /boot partition might be a good idea as well. It is small and easy to back up. A 60 MB /boot partition could be imaged and restored easily if you have problems booting later. Make an image backup of your new MBR as well for insurance.

If you use ACLs then using cp may be better then using tar.
Don't bother copying /tmp, /sys, /dev, /media, /mnt or /proc. /sys & /proc are psuedo filesystems. The device nodes in /dev are created when you boot. If you have directories under /mnt/ to mount different filesystems, then use `mkdir' to recreate them.
The files in /tmp are temporary and copying them would be a waste of time.

Then use grub-install to make the new drive bootable. I'm assuming that you will be pulling the first HD. Check if UUID #'s are used in /boot/grub/menu.lst and /etc/fstab. If so, update them with values for the new locations. E.G. If the new disk has /home on the 3rd partition, you could run: `udevinfo -q env -n /mnt/home' or follow the /dev/disk/by-id/ path to the device.
Here is an example from /etc/fstab
Code:
/dev/disk/by-id/scsi-SATA_TOSHIBA_MK2049G_48CYT01OT-part3       /home   ext3    acl,user_xattr 1 2
Here is an example from my laptop's menu.lst
Code:
title openSUSE 11.1 - 2.6.27.21-0.1
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.27.21-0.1-default root=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part6 resume=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part5 splash=silent showopts vga=0x314
    initrd /boot/initrd-2.6.27.21-0.1-default
Using the UUID or /disk/by-id/ will enable you to pull the first drive or add another on, and repartition and the entries will still be valid. The "root (hd0,5)" in this example would need to be changed however for grub to boot from the correct device.
 
Old 04-19-2009, 10:31 PM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
If you have ACLs, you can also use star in place of tar.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving my current install to a bigger hard drive vansch76 Linux - Laptop and Netbook 5 02-06-2009 10:58 AM
/proc/kcore file is getting bigger and bigger. thewhitelion Ubuntu 2 03-07-2008 09:50 AM
Bigger Hard Drive - Clone? Snump Mandriva 14 11-21-2006 08:37 AM
ghosting two hard drives? one bigger than other hedpe Linux - Hardware 2 08-09-2006 08:20 AM
Sampling bits of information in bigger and bigger pieces lugoteehalt General 0 10-29-2003 05:38 AM


All times are GMT -5. The time now is 05:00 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration