Unix Technical Forum

How to move/copy linux installation ...

This is a discussion on How to move/copy linux installation ... within the Linux Operating System forums, part of the Unix Operating Systems category; --> from one disk(a smaller one) to a new one(bigger)? And how to make the new disk bootable? Thanks...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 04:26 PM
Useko Netsumi
 
Posts: n/a
Default How to move/copy linux installation ...

from one disk(a smaller one) to a new one(bigger)? And how to make the new
disk bootable?

Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-17-2008, 04:26 PM
Bit Twister
 
Posts: n/a
Default Re: How to move/copy linux installation ...

On Thu, 30 Oct 2003 22:06:02 -0500, Useko Netsumi wrote:
> from one disk(a smaller one) to a new one(bigger)? And how to make the new
> disk bootable?



have you looked in the howtos, if you installed them
Watch out for line wrap.

locate -i disk | grep -i howto | grep -i upgrade
cut/paste something like
</usr/share/doc/HOWTO/HTML/en/mini/Linux-minis-20030211/mini/Hard-Disk-Upgrade/index.html>
</usr/share/doc/HOWTO/HTML/en/mini/Hard-Disk-Upgrade/index.html>


If not on your disk, http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/



very large FAQ search engine
http://groups.google.com/advanced_group_search
google_reinstall_boot_loader_search_tag in the first box
comp.os.linux in the Newsgroup box, pick english


Please read http://www.catb.org/~esr/faqs/smart-questions.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 04:26 PM
David
 
Posts: n/a
Default Re: How to move/copy linux installation ...

Useko Netsumi wrote:
> from one disk(a smaller one) to a new one(bigger)? And how to make the new
> disk bootable?


Partitions the new disk the way you want it. You can add/remove
partitions and or change filesystems if you want as long as you
edit /newdisk/etc/fstab to reflect any changes made in the
filesystem or partitions.

cd /
mkdir newdisk
mount /dev/hdXX /newdisk
cp -a bin boot etc dev ....... /newdisk
umount /newdisk

Repeat for any other partitions needed.

If you move the new disk to the device the old disk was on then
you won't have to edit /newdisk/etc/fstab unless you change
filesystems or partitions.

Then use a bootdisk or the CD to boot the system so you can
install lilo or grub to the MBR.

If anything goes wrong you will still have the original disk to
it try again.

--
Confucius: He who play in root, eventually kill tree.
Registered with The Linux Counter. http://counter.li.org/
Slackware 9.1.0 Kernel 2.4.22 SMP i686 (GCC) 3.3.2
Uptime: 24 days, 9:08, 2 users, load average: 0.00, 0.04, 0.1

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 04:26 PM
Douglas Mayne
 
Posts: n/a
Default Re: How to move/copy linux installation ...

On Thu, 30 Oct 2003 22:06:02 -0500, Useko Netsumi wrote:

> from one disk(a smaller one) to a new one(bigger)? And how to make the new
> disk bootable?
>
> Thanks
>

Check this:
http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/

It shows methods using cp and tar.


For the loader, I recommend grub:
http://www.gnu.org/software/grub/

--
Douglas Mayne


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-17-2008, 04:26 PM
Steffen Kluge
 
Posts: n/a
Default Re: How to move/copy linux installation ...

According to Useko Netsumi <_no-spam_usenets@nyc.rr.com>:
>from one disk(a smaller one) to a new one(bigger)? And how to make the new
>disk bootable?


I've made identical copies on several occasions using dd:

# dd if=/dev/hda of=/dev/hdc bs=512

The target disk must have at least as many blocks as the source
disk, and you should scan it to make sure it free from bad
blocks.

This takes care of the boot sector, as well.

Cheers
Steffen.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-17-2008, 04:26 PM
Alan Connor
 
Posts: n/a
Default Re: How to move/copy linux installation ...

On Thu, 30 Oct 2003 22:06:02 -0500, Useko Netsumi <_no-spam_usenets@nyc.rr.com> wrote:
>
>
> from one disk(a smaller one) to a new one(bigger)? And how to make the new
> disk bootable?
>
> Thanks
>
>


partition and format the new disk, flagging the bootable partition

mount the disk and use cp -a to copy everything over, and I'd do
it one paritition/top_directory at a time, though there is technically
no reason not to do it all at once.

I did it like this:

mount -t ext2 /dev/hdb1 mnt

mkdir /mnt/boot


/boot# cp -a * /mnt/boot

Then edit /etc/fstab on the new box and run lilo

--
Alan C this post ends with w
q
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-17-2008, 04:26 PM
Brane
 
Posts: n/a
Default Re: How to move/copy linux installation ...

Steffen Kluge wrote:

> According to Useko Netsumi <_no-spam_usenets@nyc.rr.com>:
>>from one disk(a smaller one) to a new one(bigger)? And how to make the new
>>disk bootable?

>
> I've made identical copies on several occasions using dd:
>
> # dd if=/dev/hda of=/dev/hdc bs=512
>
> The target disk must have at least as many blocks as the source
> disk, and you should scan it to make sure it free from bad
> blocks.
>
> This takes care of the boot sector, as well.
>
> Cheers
> Steffen.



Yeah, but can it screw filesystem into not using all the available space on
new, bigger disk ?

I know this is usefull for copying into partition of the same size, but what
happens when partition size changes ?

My vote goes for the solution of the other poster: copy (almost) all maps
and install GRUB bootsector and that should be all...

Regards,


Branko
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-17-2008, 04:26 PM
mjt
 
Posts: n/a
Default Re: How to move/copy linux installation ...

Useko Netsumi wrote:

> from one disk(a smaller one) to a new one(bigger)? And how to make the new
> disk bootable?


http://www.partimage.org/
..
--
/// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
\\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
Corrupt, adj.: In politics, holding an office of trust or profit.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-17-2008, 04:27 PM
David
 
Posts: n/a
Default Re: How to move/copy linux installation ...

Alan Connor wrote:
>
> partition and format the new disk, flagging the bootable partition


This is a windows thing. Linux doesn't use it.

--
Confucius: He who play in root, eventually kill tree.
Registered with The Linux Counter. http://counter.li.org/
Slackware 9.1.0 Kernel 2.4.22 SMP i686 (GCC) 3.3.2
Uptime: 24 days, 21:24, 2 users, load average: 0.01, 0.18, 0.5

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-17-2008, 04:27 PM
Useko Netsumi
 
Posts: n/a
Default Re: How to move/copy linux installation ...

David, I can follow your procedure but there is one issues. I don't have a
floppy disk.

So, how do I copy all to the new disk and install GRUB/LILO as well without
rebooting. Then, I'll take out the old disk, put the new one in place and
boot.

PS: The new disk is an external disk using PCMCIA connector. I can see this
disk but I don't think I can boot of this way. I have to take out the old
disk and replace them with the new one.

Thanks


"David" <thunderbolt01@netscape.net> wrote in message
news:WFkob.65855$Tr4.184592@attbi_s03...
> Useko Netsumi wrote:
> > from one disk(a smaller one) to a new one(bigger)? And how to make the

new
> > disk bootable?

>
> Partitions the new disk the way you want it. You can add/remove
> partitions and or change filesystems if you want as long as you
> edit /newdisk/etc/fstab to reflect any changes made in the
> filesystem or partitions.
>
> cd /
> mkdir newdisk
> mount /dev/hdXX /newdisk
> cp -a bin boot etc dev ....... /newdisk
> umount /newdisk
>
> Repeat for any other partitions needed.
>
> If you move the new disk to the device the old disk was on then
> you won't have to edit /newdisk/etc/fstab unless you change
> filesystems or partitions.
>
> Then use a bootdisk or the CD to boot the system so you can
> install lilo or grub to the MBR.
>
> If anything goes wrong you will still have the original disk to
> it try again.
>
> --
> Confucius: He who play in root, eventually kill tree.
> Registered with The Linux Counter. http://counter.li.org/
> Slackware 9.1.0 Kernel 2.4.22 SMP i686 (GCC) 3.3.2
> Uptime: 24 days, 9:08, 2 users, load average: 0.00, 0.04, 0.1
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:00 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com