Apr 1 2008, 07:20 PM
Post
#1
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
Decided to take the plunge and got a new 32GB A-Data CF Card today....
Want to do this swap the right way and hopefully easy way.... I assume that I can 'clone' my current Debian EABI setup on my existing 6GB microdrive over to the new 32GB CF card, right? Would this be the right way to do it? 1) Format new 32GB card and make 2 partitions; ext3 (/dev/hdc1 /mnt/cf) and a small swap (512MB on /dev/hdc2 /mnt/cf2). 2) Copy over current microdrive debian contents on hda2 over to new ext3 partition on 32GB CF card by doing: CODE #dd if=/dev/hda2 of=/dev/cf * Note: hda1 on my existing microdrive is my swap partition. So, is this correct way??? Thanks! Mark This post has been edited by ArchiMark: Apr 1 2008, 07:24 PM |
|
|
|
![]() |
Apr 2 2008, 01:44 PM
Post
#2
|
|
![]() Group: Admin Posts: 3,281 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
Decided to take the plunge and got a new 32GB A-Data CF Card today.... no, you definitely don't want to use "dd" to copy a file system between different types of media unless you guarantee the number of blocks in the partition is the same or larger on the target. anyway, "cat" is faster - it uses more buffering! the best way to copy a filesys is like this: cd /mnt/partition1 tar cf - | (cd /mnt/partition2 ; tar xf - ) tar will copy all files and devices, preserve the datestamps and protections etc. if you were l33t, you could probably also do it with cpio but I'm too lazy to look it up. so, just partition the CF appropriately. oh, do NOT use ext3, the journalling will kill the card faster. |
|
|
|
Apr 4 2008, 10:35 AM
Post
#3
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
anyway, "cat" is faster - it uses more buffering! I just realized that I don't see 'cat' below in your instructions??? Also, I thought that 'cat' is for just viewing the content of a file? QUOTE the best way to copy a filesys is like this: CODE cd /mnt/partition1 tar cf - | (cd /mnt/partition2; tar xf - ) tar will copy all files and devices, preserve the datestamps and protections etc. So, just want to make sure I understand this correctly for my situation of copying my hda2 partition with Debian EABI (hda1 is my swap partition) on it over to new partition on 32GB CF card.... So, here's the existing and new setups: Existing 6GB Microdrive hda1 is Swap Partition hda2 is Debian EABI Partition New 32GB CF Card cf1 will be new Debian EABI Partition cf2 will be new Swap Partition CODE cd /mnt/cf1 tar /mnt/hda2 - | (cd /mnt/cf1; tar xf - ) Does this look right? Thanks! |
|
|
|
Apr 4 2008, 01:58 PM
Post
#4
|
|
![]() Group: Admin Posts: 3,281 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
anyway, "cat" is faster - it uses more buffering! I just realized that I don't see 'cat' below in your instructions??? Also, I thought that 'cat' is for just viewing the content of a file? no, you could do, for example, "cat /dev/hda > /dev/hdb" to clone an entire hard drive QUOTE So, here's the existing and new setups: Existing 6GB Microdrive hda1 is Swap Partition hda2 is Debian EABI Partition New 32GB CF Card cf1 will be new Debian EABI Partition cf2 will be new Swap Partition CODE cd /mnt/cf1 tar /mnt/hda2 - | (cd /mnt/cf1; tar xf - ) Does this look right? Thanks! you're missing a dot cd /mnt/hda2 tar cf - . | (cd /mnt/cf1 ; tar xf - ) you cd into the source directory so that when you do the tar the current directory is the "root" of all the files; the "-" in the tar command outputs the stream to stdout; the stream is piped into a separate shell (the brackets) which starts in the destionation directory and unpacks the incoming stream from stdin. the same trick works over an ssh session. |
|
|
|
Apr 4 2008, 03:49 PM
Post
#5
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
anyway, "cat" is faster - it uses more buffering! I just realized that I don't see 'cat' below in your instructions??? Also, I thought that 'cat' is for just viewing the content of a file? no, you could do, for example, "cat /dev/hda > /dev/hdb" to clone an entire hard drive QUOTE So, here's the existing and new setups: Existing 6GB Microdrive hda1 is Swap Partition hda2 is Debian EABI Partition New 32GB CF Card cf1 will be new Debian EABI Partition cf2 will be new Swap Partition CODE cd /mnt/cf1 tar /mnt/hda2 - | (cd /mnt/cf1; tar xf - ) Does this look right? Thanks! you're missing a dot cd /mnt/hda2 tar cf - . | (cd /mnt/cf1 ; tar xf - ) you cd into the source directory so that when you do the tar the current directory is the "root" of all the files; the "-" in the tar command outputs the stream to stdout; the stream is piped into a separate shell (the brackets) which starts in the destionation directory and unpacks the incoming stream from stdin. the same trick works over an ssh session. THANKS for the explanation/clarification, speculatrix!! Think I got it now.... |
|
|
|
ArchiMark Swap 32gb Cf For Microdrive Apr 1 2008, 07:20 PM
adf QUOTE(ArchiMark @ Apr 1 2008, 07:20 PM) D... Apr 1 2008, 11:06 PM
tux @Archimark: I think that your cloning progedure ne... Apr 2 2008, 12:05 AM
ArchiMark QUOTE(adf @ Apr 2 2008, 12:06 AM) Oooooo ... Apr 2 2008, 05:29 AM
ArchiMark QUOTE(speculatrix @ Apr 2 2008, 02:44 PM)... Apr 2 2008, 02:41 PM
ZDevil QUOTE(speculatrix @ Apr 2 2008, 11:44 PM)... Apr 3 2008, 11:10 AM

ArchiMark QUOTE(ZDevil @ Apr 3 2008, 12:10 PM) QUOT... Apr 3 2008, 02:32 PM

adf QUOTE@adf: Archimark is talking about using and A-... Apr 3 2008, 10:32 PM
ArchiMark QUOTE(speculatrix @ Apr 4 2008, 02:58 PM)... Apr 7 2008, 07:36 AM
iwantprogress rsync also works and is faster if you need to redo... Apr 4 2008, 12:59 PM
ArchiMark QUOTE(iwantprogress @ Apr 4 2008, 01:59 P... Apr 5 2008, 04:30 PM
ArchiMark OK, tried the 'cat' approach and here... Apr 7 2008, 07:21 AM
rogalian Cat gives same results as dd - won't work unle... Apr 7 2008, 07:31 AM
speculatrix given that the cards are different sizes and there... Apr 7 2008, 07:32 AM
ArchiMark QUOTE(speculatrix @ Apr 7 2008, 08:32 AM)... Apr 7 2008, 07:41 AM
speculatrix "tar cf" is the command, "c" m... Apr 7 2008, 08:08 AM
speculatrix p.s. if you're copying with tar, the target di... Apr 7 2008, 08:10 AM
ArchiMark QUOTE(speculatrix @ Apr 7 2008, 09:10 AM)... Apr 7 2008, 08:34 AM
ArchiMark Copying over directories...most copying over OK, b... Apr 7 2008, 09:21 AM
rogalian The stuff in /proc you needn't worry about, it... Apr 7 2008, 11:30 AM
speculatrix ooops, yes, exclude /proc and /sys too. probably n... Apr 7 2008, 11:40 AM
ArchiMark Thanks for the advice, rogalian & speculatrix... Apr 7 2008, 06:32 PM
speculatrix let us know when you're back up and running. Apr 8 2008, 12:52 PM
ArchiMark QUOTE(speculatrix @ Apr 8 2008, 01:52 PM)... Apr 8 2008, 07:18 PM
speculatrix QUOTE(ArchiMark @ Apr 9 2008, 04:18 AM) S... Apr 9 2008, 08:42 AM
ArchiMark QUOTE(speculatrix @ Apr 9 2008, 09:42 AM)... Apr 11 2008, 12:35 PM
ajnk I had to do something similar last night, when I m... Apr 9 2008, 01:08 AM
ZDevil Good to know that things are working now.
ajnk: so... Apr 9 2008, 04:19 AM
ajnk QUOTE(ZDevil @ Apr 9 2008, 12:19 PM) Good... Apr 9 2008, 07:07 AM
speculatrix you will find that a file copy using tar, rsync or... Apr 11 2008, 12:54 PM
ArchiMark QUOTE(speculatrix @ Apr 11 2008, 01:54 PM... Apr 11 2008, 01:03 PM
maemorandum Does it make sense replacing the internal microdri... Apr 11 2008, 02:52 PM
ArchiMark QUOTE(maemorandum @ Apr 11 2008, 03:52 PM... Apr 11 2008, 03:36 PM
speculatrix so, archimark, have you done it yet? we eager read... Apr 12 2008, 11:34 AM
ArchiMark QUOTE(speculatrix @ Apr 12 2008, 12:34 PM... Apr 12 2008, 11:51 AM![]() ![]() |
|
Lo-Fi Version | Time is now: 18th June 2013 - 04:14 PM |