LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 08-05-2009, 05:28 AM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
Transfering partitions and dual boot grub to a bigger hard disc


Hello!

I am planning to get a new hard disc which will be bigger than the one I am using right now. My disc is 160Gb and I would like to get a 320Gb or 500Gb disc.

My dual boot system has the following partitions:

# fdisk -l
======================================================================
/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
======================================================================

fstab is:

======================================================================
proc /proc proc defaults 0 0
/dev/sda3 / ext3 errors=remount-ro 0 1
/dev/sda6 /home ext3 defaults 0 2
/dev/sda2 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sda1 /media/windows ntfs-3g defaults 0 0
/dev/sda5 /media/fat32 vfat defaults,users,umask=000 0 0
======================================================================
So:
sda1 is a NTFS partition 68.36Gb (winxp)
sda2 is a SWAP partition with 2Gb.
sda3 is an ext3 partition (/) with 19.53Gb.
sda4 is an extended partition with 2 logical units (those that follow)
sda5 is a windows FAT32 partition with 19.53Gb.
sda6 is an ext3 partition (/home) with 39.62Gb.

I am using Debian Lenny 64 bits Linux distribution.

To make it clear: What I want is to move everything from my 160Gb sata drive to a bigger one taking advantage of the new size (to resize partitions). Of course, the two discs have different geometry. Everything should work OK as it is working right now on the old disc. Dual boot system with Grub bootloader (this is what I expect :-)

Should I copy partitions and MBR or the whole disc at once?

I found this somewhere in another forum (unix forum). It is used to copy the MBR. Should I do this and copy the partitions with clonezilla? What about Grub and the partition table.

=======================================================================
:
To backup the MBR you

dd if=/dev/sda of=mbrbackup bs=512 count=1

to restore the MBR you want to

dd if=mbrbackup of=/dev/sdb bs=446 count=1

If you copy more than 446 you will wipe over the partition tables, which is OK if you are copying to the same disk with the same unchanged partitions.
========================================================================

Sorry for the lenght of this post but I wanted to be as clear as possible.

Thanks in advance for your help!
Glore2002.-
 
Old 08-05-2009, 06:49 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by glore2002 View Post
I found this somewhere in another forum (unix forum). It is used to copy the MBR. Should I do this and copy the partitions with clonezilla? What about Grub and the partition table.
You may want to try a Parted Magic live CD:
http://partedmagic.com/
Parted Magic now comes with Clonezilla. I have used Parted Magic to re-partition my hard drives, but I have not used Clonezilla. The Parted Magic live CD with Clonezilla should be able to do what you want to do though.
 
Old 08-05-2009, 10:30 AM   #3
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Thanks Tommcd for your suggestion!

Once in parted magic What steps should I follow to copy partitions (win and linux) to the new drive, resize them and making Grub work as well?

I can start by creating images of the partitions with Clonezilla. What's next?

Thanks again for your cooperation.
Glore2002.-
 
Old 08-06-2009, 03:09 AM   #4
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Quote:
Originally Posted by glore2002 View Post
Once in parted magic What steps should I follow to copy partitions (win and linux) to the new drive, resize them and making Grub work as well?

I can start by creating images of the partitions with Clonezilla. What's next?
I have not actually used Clonezilla. I have been using Parted Magic for some time though to partition or resize hard drives. The Parted Magic live CD now comes with the Clonezilla command line partition tool. Here is a video that explains how to use it:
http://www.jupiterbroadcasting.com/?p=567
You may want to try a Clonezilla live CD, which you can get here:
http://clonezilla.org/clonezilla-live/doc/
and the documentation for the Clonezilla live CD is here:
http://clonezilla.org/clonezilla-live/doc/
For grub, I would think that if Clonezilla copies the MBR to the new hard drive, then it should boot just the same as the old drive. If it does not, then you can always restore grub to the MBR like this (example is from Ubuntu live CD):
http://ubuntuforums.org/showthread.p...highlight=fsck
 
Old 08-07-2009, 05:35 AM   #5
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Thanks again!
This weekend, I am planning to buy the new HD and then I will tell you what happened. I will also ask for help if, while transfering the system- any problem appears :-)

Thanks,
Glore2002.-
 
Old 08-09-2009, 11:51 AM   #6
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Smile Finally, I moved my system.

First of all, thanks for your help!

I've finally moved my system. How? I made the following steps.

#1) I boot my system with Parted Magig 4.3 (usb version - Pendrive).
#2) I've used Clonezilla to copy the entire 160Gb old disc to the new 500Gb disc. Clonezilla uses partclone to copy partitions. My system had a NTFS partition, two ext3 partitions (/ and /home), SWAP partition and a 20Gb FAT32 partition. Clonezilla asks for copying also MBR (bs=446) to the new disc. I've answered "YES".
#3) After copying discs, I booted up my computer with the new disc. It worked! Grub included. I must recognize, I didn't expect Grub working but it did!
#4) The only partition with some problems (many fsk...files) was FAT32 partition. It wasn't big deal because I re-formatted the partition and copied everything back from the old disc. So, as a conclusion, I can say FAT32 partitions are not the best ones to keep important things.
#5) The rest of the partitions were OK. Then I could boot again in Debian or win using Grub as the bootloader.
#6) The results were the same partitions as the old disc plus an unpartitioned section of the new disc.
#7) I've resized the extended partition and I've also created two new partitions for backup purposes. A new ext3 partition (/backup) and a NTFS partition (winbackup). I've added them in fstab and gave them access permissions with chmod 777.

Now, my system is working and I feel happy with the results. Thanks for all your help and patience.

I recommend Parted Magic and Clonezilla as partition and backup tools.


Thanks again,

Glore2002.-

Last edited by glore2002; 08-09-2009 at 11:52 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving to a bigger hard disc. glore2002 Debian 2 04-19-2009 10:31 PM
Solved: Dual boot, deleted /boot and all linux partitions, system boots to grub> cuco76 Linux - Software 0 01-06-2009 05:27 PM
Transfering hard drive w/ linux from separate computer to dual boot with Windows comp SonicGT Linux - Newbie 1 03-18-2006 02:56 PM
Fedora Core 3 Dual Boot, Dual Hard drives, Grub Boot Loader Denali03 Linux - Newbie 1 03-04-2005 01:44 PM
Server Hard-disc partitions. MeddlePAL Linux - General 1 06-26-2004 09:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration