LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2011, 06:27 AM   #1
zemir
LQ Newbie
 
Registered: Jul 2011
Location: Calabria, ITALY
Distribution: debian squeeze
Posts: 24

Rep: Reputation: Disabled
Using DD to transfer one partition to another different size partition


Hi, i am newbie about this forum and i hope to stay with you for many time ;-)....... i have a problem, i think very common, but i am not able to find a right solution:
i have got an old computer with some partition and one have linux slackware installed; it is all included there (root and a swap file); its size is almost 4 gb. Now i have a new laptop and i do not really want to reinstall linux on it; simply i want to transfer all things from old on new computer. The size of new hd is almost 12 Gb and i want to use entire with linux slackware. I will recompile new kernel on old computer for the new. Now, i think to use dd to make one image, this follow command may be good, i think:
"dd if=/dev/hda3 of=./linux_slackaware.img bs=4096 conv=noerror"
I use zipslack on msdos partition (hda2) to run this command; it will make a 4 gb file image partition;
Now i ask you:
it is possible to transfer and to adapt this image partition on a different size image partition?
The new is 12 gb size.........what are the right dd command parametres?
 
Old 07-24-2011, 09:05 AM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by zemir View Post
it is possible to transfer and to adapt this image partition on a different size image partition?
Yes, I think it is possible to do this. Whether it is advisable is another question. (And I'm not sure I'd use 'conv=noerror'.)

Quote:
The new is 12 gb size.........what are the right dd command parametres?
You just want to do the reverse of your original 'dd' command.

You didn't say, so I'm assuming your filesystem is ext2/3/4; and I'm also assuming you have already partitioned the new laptop, and /dev/hda1 is the partition that is to receive the old filesystem. (If it's not hda, then it may be sda.)

Then this would work.
Code:
dd of=/dev/hda1 if=<correct_path_to>/linux_slackaware.img bs=4096
You'd now have a /dev/hda1 that showed 12GB in fdisk; and your filesystem would be reported as 4GB with 'df -h'.

To remedy this and grow the filesystem out to the size of the partition use 'resize2fs' (again assuming ext2/3/4).
Code:
resize2fs /dev/hda1
As others may report as well, copying a system installed on one system to another with dissimilar hardware may not be advisable. It may not work at all, depending on specialized drivers that may be required on the new machine. (I've had mixed results doing this in the past.)

And don't forget that once your filesystem is moved to the new machine you will have to write a bootloader to the MBR. (Being Slackware I think that still means lilo, not Grub.)

Good luck.

p.s. I think most people would use 'tar' to perform this task.

Last edited by tommylovell; 07-24-2011 at 09:08 AM.
 
1 members found this post helpful.
Old 07-24-2011, 01:58 PM   #3
zemir
LQ Newbie
 
Registered: Jul 2011
Location: Calabria, ITALY
Distribution: debian squeeze
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks tommylovell
Quote:
Originally Posted by tommylovell View Post
You didn't say, so I'm assuming your filesystem is ext2/3/4;
of course, it is ext2
Quote:
Originally Posted by tommylovell View Post
You'd now have a /dev/hda1 that showed 12GB in fdisk; and your filesystem would be reported as 4GB with 'df -h'.

To remedy this and grow the filesystem out to the size of the partition use 'resize2fs' (again assuming ext2/3/4).
Code:
resize2fs /dev/hda1
I have not used very often "DD" and "Resize2fs" therefore i have asked about.

Quote:
Originally Posted by tommylovell View Post
As others may report as well, copying a system installed on one system to another with dissimilar hardware may not be advisable. It may not work at all, depending on specialized drivers that may be required on the new machine. (I've had mixed results doing this in the past.)
It is a good choice, especially when you do not really want to reinstall a new system. I will recompile a monolitic kernel (2.4 version) in the old pc therefore i will install it in the new, no more drivers i will need.

Quote:
Originally Posted by tommylovell View Post
And don't forget that once your filesystem is moved to the new machine you will have to write a bootloader to the MBR. (Being Slackware I think that still means lilo, not Grub.)
I will start the new sistem with loadlin from ms-dos startup usb pen therefore i will install lilo from the working new linux system. It is very simple.
Quote:
Originally Posted by tommylovell View Post
Good luck.
Thanks!
 
Old 07-24-2011, 03:04 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hello zemir,

you can also use the tar command to create an archive of the whole Linux-system. Then create a filesystem on the new Laptop and extract the archive there. I would do both with a live-CD or USB.

Be aware that there you may expect difficulties with the hardware, for example the devicenodes in the /dev directory

Actually a complete new Slackware-installation is done within 10 Minutes. Could you please provide more information about the hardware of the new laptop.

Markus
 
1 members found this post helpful.
Old 07-24-2011, 03:58 PM   #5
zemir
LQ Newbie
 
Registered: Jul 2011
Location: Calabria, ITALY
Distribution: debian squeeze
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by markush View Post
Hello zemir,

you can also use the tar command to create an archive of the whole Linux-system. Then create a filesystem on the new Laptop and extract the archive there. I would do both with a live-CD or USB.

Be aware that there you may expect difficulties with the hardware, for example the devicenodes in the /dev directory

Actually a complete new Slackware-installation is done within 10 Minutes. Could you please provide more information about the hardware of the new laptop.

Markus
Hi Markush and thanks. 10 minutes to install but i think more, very more, to change the scripts, files config, home files, etc.... and much more things. I have a very minimal system that does not occupies than 250/300 mb and to make another time the same result i do not really want. About devices, i think to remove or to make them; in the case i will have problems, quickly i will inform you. I will try the "dd" way and the "tar" way then i will inform you about, in august, i think.
However, thanks!
 
Old 07-24-2011, 04:17 PM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by zemir View Post
...10 minutes to install but i think more, very more, to change the scripts, files config, home files, etc.... and much more things.
No, this isn't the case, nowadays (with Slackware 13.37) with Slackware everything works out of the box. If you're not very experienced, you will have less difficulties with a new installation on a new computer.

Markus
 
Old 07-25-2011, 05:18 AM   #7
zemir
LQ Newbie
 
Registered: Jul 2011
Location: Calabria, ITALY
Distribution: debian squeeze
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by markush View Post
No, this isn't the case, nowadays (with Slackware 13.37) with Slackware everything works out of the box. If you're not very experienced, you will have less difficulties with a new installation on a new computer.

Markus
I am not very expert but i am not newbie about slackware, too; then i know what i do; i have not a slackware standard release, i install and upgrade only my necessary package; in some cases i do not install standard packages and i prefer to install binaries or recompile sources. I have changed some shell scripts. My system is unique. The two computers (the old and the new) are very similar. However in case of problem, i will inform you.
Thanks again!
 
Old 07-30-2011, 07:46 AM   #8
zemir
LQ Newbie
 
Registered: Jul 2011
Location: Calabria, ITALY
Distribution: debian squeeze
Posts: 24

Original Poster
Rep: Reputation: Disabled
Solved with 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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Increasing the size of an extended partition to allow the creation of a new partition chakkerz Linux - Server 4 05-18-2010 11:18 PM
tricky backup of Linux system to NTFS partition to increase partition size Pandarsson Linux - General 5 07-09-2008 03:35 PM
Data Transfer From Redhat Linux Partition to Fat32 Partition saraturtle Linux - General 20 04-04-2007 06:20 PM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 01:55 PM
fdisk partition size differs from mounted partition size jimieee Linux - General 3 10-15-2003 04:10 AM


All times are GMT -5. The time now is 12:44 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration