You are not logged in.

#1 2009-05-25 21:03:01

bwh1969
Member
Registered: 2008-01-05
Posts: 151

How do I copy a live runing system to a disk

I have been using chakra-live on my laptop via a pen drive and I have it nicely configured using session saving but I get to a point where installing new packages won't work because a full upgrade is not practical (I get dependency issues).

I have a 30 GB 2.5" hard drive.  Rather than go through the usual "install" and start from scratch  I would much rather copy what I already have running.  Being that it is running live, it is the only way to get the overlays to merge and have a duplicate system.

I know there are certain commands I can use, and it does not always work well, but assume that I not utilize the OS for anything while the copying is taking place,

what would be the proper command (I don't think cp, as it won't copy symlinks and permissions and such) to copy the entire root directory / to another empty disk formatted as ext3 (i.e /dev/sda)?  I know how to install grub to the mbr later.

It is an empty disk, so if it does not work, no big deal.

Offline

#2 2009-05-28 15:45:46

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: How do I copy a live runing system to a disk

what about ...

(cd $SRC_ROOT && tar cf - .)|(cd $DEST_ROOT && tar xvpf -)

Offline

#3 2009-05-28 19:24:53

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: How do I copy a live runing system to a disk

cp preserves metadata if you use the -a flag. Not sure about symlinks though.

Offline

#4 2009-05-30 02:39:29

bwh1969
Member
Registered: 2008-01-05
Posts: 151

Re: How do I copy a live runing system to a disk

perbh>

I think that is what I have seen. If the drive is seen as sda1 and my root system is obviously / , would the code be

(cd / && tar cf - .)|(cd /dev/sda1 && tar xvpf -)

or do I need the $ also

(cd $/ && tar cf - .)|(cd $/dev/sda1 && tar xvpf -)

Offline

#5 2009-05-30 02:54:24

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: How do I copy a live runing system to a disk

I've used cp (cp -ax) many times without issues.

The best way to copy from the live running system would be to logout, then run 'init 1' in the console. You can also get into single user mode by adding '1' to your kernel boot line. This will drop you down to single user mode, where you should be able to copy the system without any problems.

Offline

#6 2009-05-30 08:35:17

thisllub
Member
From: Northern NSW Australia
Registered: 2007-12-28
Posts: 231

Re: How do I copy a live runing system to a disk

If you want to make a habit of this LVM is the way to go.
You can make a snapshot and copy that.

Offline

#7 2009-05-30 12:11:53

bwh1969
Member
Registered: 2008-01-05
Posts: 151

Re: How do I copy a live runing system to a disk

Logical Volume Manager?  I googled it and it seems to be what it stands for... I am reading http://linux.about.com/od/commands/l/blcmdl8_lvm.htm and I am unsure how to apply it in my case.

Offline

Board footer

Powered by FluxBB