LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-17-2014, 03:05 PM   #1
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Rep: Reputation: 32
cloning several disks to one?


i can't seem to find a clear answer to this question....

i have two existing 1tb disks on my system /dev/sda (with 4 partitions on it), /dev/sdb (one partition)

current fstab is:
Code:
/dev/sda4        swap             swap        defaults         0   0
/dev/sda2        /                ext3        defaults         1   1
/dev/sda1        /home            ext3        defaults         1   2
/dev/sda3        /test            ext3        defaults         1   2
/dev/sdb1        /space           ext3        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
i want to clone the whole system on to one 3tb drive, and haven't been able to find a clearly defined way to do it. the 3tb drive is currently on a usb external which cfdisk finds at /dev/sdd (no partitions on it yet)
any help would be appreciated (and i realize there's probably at least 3 ways to do this, but i'd like this to boot cleanly too when i put the 3tb drive in the machine as /dev/sda with a minimum of fuss)
 
Old 05-17-2014, 03:43 PM   #2
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,520

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
I would boot from a Slackware boot disk, then mount your old tree under /mnt/old, e.g.:

Code:
mkdir -p /mnt/old/{home,test,space}
/dev/sda2 /mnt/old
/dev/sda1 /mnt/old/home
/dev/sda3 /mnt/old/test
/dev/sdb1 /mnt/old/space
Format your new disk and mount it under /mnt/new. Then copy everything from /mnt/old to /mnt/new using your tool of choice (rsync, cpio, etc.). Then chroot into /mnt/new and reconfigure and install your boot manager.
 
1 members found this post helpful.
Old 05-17-2014, 04:29 PM   #3
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Original Poster
Rep: Reputation: 32
tnx, that looks like it will work.... now to plan a time to do it
 
Old 05-18-2014, 12:32 AM   #4
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,520

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
Also remember to update your fstab!
 
Old 05-18-2014, 03:42 AM   #5
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Original Poster
Rep: Reputation: 32
yeah, i figured that might be needed.... what i actually wen with was mounting the new drive at /mnt and copying everything with
Code:
tar cvpf -  --exclude /proc   --exclude /mnt   /*  | tar xf -   -C /mnt
so i can make the copy "live" with as little downtime as possible.... hopefully after it's done i should be able to install lilo and swap the disks
 
Old 05-18-2014, 04:37 AM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,520

Rep: Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664Reputation: 1664
That should do it, yeah. When you generated an initrd last time around did you reference the root disk by device name. If so that might be something else to consider.

Also remember to recreate the /mnt director(y|ies) on your copy, since you (rightly) excluded it.
 
Old 05-19-2014, 02:24 AM   #7
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Original Poster
Rep: Reputation: 32
it's kind of on hold for now.... having trouble getting slack 14.1 installed on the disk
had the disk in a lenovo desktop and everything seemed to be going fine until it began trying to install packages and the disk seems to disappear

i can read and write to it fine as long as it's in a usb external case however....

i think the HP tower i'm using as the primary machine is newer than the lenovo

i'll try agn soon

Last edited by unclejed613; 05-19-2014 at 02:28 AM.
 
Old 05-19-2014, 07:57 AM   #8
enine
Senior Member
 
Registered: Nov 2003
Distribution: Slackʍɐɹǝ
Posts: 1,348
Blog Entries: 4

Rep: Reputation: 206Reputation: 206Reputation: 206
Another way to do it live would be to mount the new disk then rsync everything from old to new. Whatever files are in sue and can't be copied srync will skip over. Then when you are ready to make the final switch over boot from the install cd and run rsync again to get anything missed.

I had to do this a few years back n a windoze server, it had many thousands of small files and copying from one disk to another took hours and hours. I used the equiv of rsync (robocopy) and would copy over whatever it could get over a weekend then stop the job Monday morning then start again the next weekend. Since it was copying only what changed after a couple weeks we got through most of the files then just had to copy the last few that changed before switching over.
 
Old 05-19-2014, 08:13 AM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,290

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
if you are looking for imaged clones you could try drag-and-drop'ing the partitions using something like gparted live-usb.
else something like this mite work:
caution: dd can be very destructive if you are not exactly sure what your partitions are enumerated by
Code:
dd if=/dev/sda of=/dev/sdx bs=16M
# then use gparted gui to create another partition on the 3tb disk
dd if=/dev/sdb1 of=/dev/sdx5 bs=16M
 
Old 05-19-2014, 03:59 PM   #10
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Original Poster
Rep: Reputation: 32
yeah i'm very careful with dd.... only use it when i absolutely have to.... definitely need to research this in a bit more depth before i carry it out. i have a 6 or 7 year old hitachi drive in the machine now.... the drive has survived 3 machines so far without a hiccup.... started using the drive with slack 12.0 currently using 13.37


i treat dd as i would a firearm.... you can't undo it if you make a mistake, and you must be pointing it at the right target for the right reasons.

Last edited by unclejed613; 05-19-2014 at 04:09 PM.
 
Old 05-19-2014, 08:02 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,757

Rep: Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361Reputation: 3361
I'd consider a file based clone for the first disk. Then I'd just tar or rsync or gparted or partimage over the /space data.

Be sure you understand that any clone may need various settings changed. Grub and fstab type of issues may need to be generic then back to specific on new system.
 
  


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
New RHES - how to resize current disks and create new the disks spuds99 Linux - Server 3 09-29-2013 06:13 PM
[SOLVED] added a couple of new disks and now /dev/sd* disks are all messed up nass Linux - Hardware 4 10-30-2012 10:16 AM
[SOLVED] RAID 5 with 4 hard disks... array started with only 3 out of 4 disks kikinovak Slackware 9 08-11-2012 06:33 AM
Installation Disks not recognized as official disks when booting with floppy coal-fire-ice Mandriva 13 12-09-2004 04:29 PM

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

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