LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-29-2006, 06:43 AM   #1
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Rep: Reputation: 15
Copying System


I've installed a copy of LFS on one of my hard disks partitions. I'd like to make a complete copy of the system to another partition and have done so with the 'cp -axv' command.
However when I reboot into the 'copied' system it halts halfway through booting complaining it is 'unable to open a console'.
Can anyone help me with this?

Thanks,

Harry
 
Old 06-29-2006, 06:52 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
in general, you cannot copy a whole system using cp or similat commands. For starters, the boot process will not work because the boot loader will not know where to find the startup files. Depending on the configuration, there may also be code in the partition boot sector which does not get copied using cp.

What is on the system besides LFS?
What is the boot loader--eg GRUB, LILO, etc.?
 
Old 06-29-2006, 07:00 AM   #3
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Grub is installed on the MBR. Theres is a copy of GeeXboX and OpenSUSE 10 also on the system and all the kernels are installed into a seperate /boot partition of the hard drive.
I've altered menu.lst to add the relavent changes to include the 'copyed' system and altered the 'root' to point at the new system.
 
Old 06-29-2006, 07:15 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
HMMM...
I'm assuming that the system works with strange things like all the kernels in a common /boot partition. (I can't quite picture how GRUB boots into "/boot" and then the system knows which "/" to go to.)

When you say that you altered 'root' to point at the copied system, how does that relate to the statement that all the kernels are in one /boot?

To go further, we should also see the output of "fdisk -l" and the contents of the grub config file: /boot/grub/menu.lst

Alternatively, how about doing all this in more conventional ways---eg make a new partition and install the OS to it.
 
Old 06-29-2006, 07:20 AM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
Quote:
Originally Posted by pixellany
HMMM...
I'm assuming that the system works with strange things like all the kernels in a common /boot partition. (I can't quite picture how GRUB boots into "/boot" and then the system knows which "/" to go to.)

When you say that you altered 'root' to point at the copied system, how does that relate to the statement that all the kernels are in one /boot?
Grub boot the kernel in the /boot partition and the kernel is told what partition to use for / with the root= option
eg:
Quote:
title Ubuntu, kernel 2.6.15-25-686 Default
root (hd0,0)
kernel /boot/vmlinuz-2.6.15-25-686 root=/dev/hda1 ro quiet
initrd /boot/initrd.img-2.6.15-25-686
savedefault
boot
 
Old 06-29-2006, 07:27 AM   #6
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Original Poster
Rep: Reputation: 15
This is how the entries in menu.lst are set out:

title LFS
root (hd0,0)
kernel /lfskernel-2.6.11.12 root=/dev/sda5

title LFS Copy
root (hd0,0)
kernel /lfskernel-2.6.11.12 root=/dev/sda6

The kernels boot out of sda1, ie; root (hd0,0) in Grub and are mounted as /boot, and the filesystems in sda's5 & 6 are then mounted as /.
 
Old 06-29-2006, 07:30 AM   #7
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by binary_y2k2
Grub boot the kernel in the /boot partition and the kernel is told what partition to use for / with the root= option
eg:
Exactly - anyway the system is definately booting the kernel and trying to use the correct filesystem - it's just as the system starts to come up it's unable to access a console - could this be a /dev issue?
 
Old 06-29-2006, 07:34 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
OK--I am maybe in over my head.

to research further, what happens if you clone the partition instead of just copying all the files?

but I also still question why you dont just make a new partition and install rather than try to copy.
 
Old 06-29-2006, 07:38 AM   #9
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Original Poster
Rep: Reputation: 15
I want to keep the original system as it is - and use the copy as a testing system, but don't really want to have to compile all the packages again a second time just to do so.
 
Old 06-29-2006, 07:47 AM   #10
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
It could be, you should check that everything in /dev/is ok & has the correct permissions.
An easier wat to copy the system is to do it from a liveCD because of pseudo file systems, /dev is one that has pseudo files and ones written to the HDD
Eg, I use hda3 for bleeding edge testing, but when nothing is mounted in it there are still files in /dev.
Code:
ls /mnt/hda3/dev
agpgart   dsp    i2c-4    loop3    md11  md6     midi03  mpu401data  pktcdvd3  ram12  ram6     rmidi3     tty0  tty9
audio     dsp1   i2c-5    loop4    md12  md7     midi1   mpu401stat  port      ram13  ram7     sequencer  tty1  urandom
audio1    dsp2   i2c-6    loop5    md13  md8     midi2   null        ptmx      ram14  ram8     shm        tty2  zero
audio2    dsp3   i2c-7    loop6    md14  md9     midi3   parport0    pts       ram15  ram9     smpte0     tty3
audio3    full   initctl  loop7    md15  mem     mixer   parport1    ram       ram16  random   smpte1     tty4
audioctl  i2c-0  kmem     MAKEDEV  md2   midi0   mixer1  parport2    ram0      ram2   raw1394  smpte2     tty5
console   i2c-1  loop0    md0      md3   midi00  mixer2  pktcdvd0    ram1      ram3   rmidi0   smpte3     tty6
core      i2c-2  loop1    md1      md4   midi01  mixer3  pktcdvd1    ram10     ram4   rmidi1   sndstat    tty7
dev       i2c-3  loop2    md10     md5   midi02  mouse   pktcdvd2    ram11     ram5   rmidi2   tty        tty8
also you used the -x option in cp so it may not have copied /dev at all?

[EDIT]You could use dd to copy the whole partition[/EDIT]

Last edited by binary_y2k2; 06-29-2006 at 07:49 AM.
 
Old 06-29-2006, 07:53 AM   #11
hgnoel1980
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by binary_y2k2
It could be, you should check that everything in /dev/is ok & has the correct permissions.
An easier wat to copy the system is to do it from a liveCD because of pseudo file systems, /dev is one that has pseudo files and ones written to the HDD
Eg, I use hda3 for bleeding edge testing, but when nothing is mounted in it there are still files in /dev.
Code:
ls /mnt/hda3/dev
agpgart   dsp    i2c-4    loop3    md11  md6     midi03  mpu401data  pktcdvd3  ram12  ram6     rmidi3     tty0  tty9
audio     dsp1   i2c-5    loop4    md12  md7     midi1   mpu401stat  port      ram13  ram7     sequencer  tty1  urandom
audio1    dsp2   i2c-6    loop5    md13  md8     midi2   null        ptmx      ram14  ram8     shm        tty2  zero
audio2    dsp3   i2c-7    loop6    md14  md9     midi3   parport0    pts       ram15  ram9     smpte0     tty3
audio3    full   initctl  loop7    md15  mem     mixer   parport1    ram       ram16  random   smpte1     tty4
audioctl  i2c-0  kmem     MAKEDEV  md2   midi0   mixer1  parport2    ram0      ram2   raw1394  smpte2     tty5
console   i2c-1  loop0    md0      md3   midi00  mixer2  pktcdvd0    ram1      ram3   rmidi0   smpte3     tty6
core      i2c-2  loop1    md1      md4   midi01  mixer3  pktcdvd1    ram10     ram4   rmidi1   sndstat    tty7
dev       i2c-3  loop2    md10     md5   midi02  mouse   pktcdvd2    ram11     ram5   rmidi2   tty        tty8
also you used the -x option in cp so it may not have copied /dev at all?

[EDIT]You could use dd to copy the whole partition[/EDIT]
Cheers - I'll give this a try.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying root system to another partition TheOneAndOnlySM Linux - General 5 06-01-2005 04:03 PM
copying files in RH9 from 1 harddisk to another in same system(internal) rajivb Linux - Newbie 8 03-09-2005 10:24 AM
Installing RedHat 8.0 on Win98 Intel system reboots computer before copying files. livatlantis Linux - Newbie 10 08-15-2004 02:25 PM
Copying Users to a 2nd System jtk69 Linux - General 1 01-02-2004 05:49 PM
Question on File System and File Copying hey_joe Linux - Newbie 2 11-05-2003 10:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:43 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