OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
> Swap 32gb Cf For Microdrive, Easy Way to Do This...
ArchiMark
post Apr 1 2008, 07:20 PM
Post #1





Group: Members
Posts: 1,026
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....

rolleyes.gif

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
Go to the top of the page
 
+Quote Post
adf
post Apr 1 2008, 11:06 PM
Post #2





Group: Members
Posts: 2,821
Joined: 13-September 04
From: Wasilla Ak.
Member No.: 4,572



QUOTE(ArchiMark @ Apr 1 2008, 07:20 PM) *
Decided to take the plunge and got a new 32GB A-Data CF Card today....

rolleyes.gif

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


Oooooo Nooooo. How fast is it? Was it priced reasonably?
I've never moved stuff with dd like that--I'd have tried tar, but only on fa,iliarity, not on the belief that tar would be a better way to do it. You are probably right.
Go to the top of the page
 
+Quote Post
tux
post Apr 2 2008, 12:05 AM
Post #3





Group: Members
Posts: 450
Joined: 12-August 03
From: Leeds, UK
Member No.: 346



cool.gif @Archimark: I think that your cloning progedure needs some input from someone who has tried it. Possibly ZDevil or some of the others who have tarred up filesystems might be able to give some good advice here about using their methods. smile.gif

@adf: Archimark is talking about using and A-Data card. I remember you posting about major problems getting Debian to work on your transplanted A-data card. Did you solve those problems?

Cheers

This post has been edited by tux: Apr 2 2008, 12:07 AM
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 2 2008, 05:29 AM
Post #4





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(adf @ Apr 2 2008, 12:06 AM) *
Oooooo Nooooo. How fast is it? Was it priced reasonably?
I've never moved stuff with dd like that--I'd have tried tar, but only on fa,iliarity, not on the belief that tar would be a better way to do it. You are probably right.


I'm not sure how fast it is....but it was priced very reasonably I though from SuperMediaStore.com....

$149.99 for the 32GB CF and $69.99 for a 16GB SDHC Card....

tongue.gif

QUOTE(tux @ Apr 2 2008, 01:05 AM) *
cool.gif @Archimark: I think that your cloning progedure needs some input from someone who has tried it. Possibly ZDevil or some of the others who have tarred up filesystems might be able to give some good advice here about using their methods. smile.gif

Sounds like a good idea, tux.....

ZDevil, where are you???.... or anyone else....

wink.gif


Cheers

Go to the top of the page
 
+Quote Post
speculatrix
post Apr 2 2008, 01:44 PM
Post #5





Group: Admin
Posts: 3,281
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149



QUOTE(ArchiMark @ Apr 2 2008, 04:20 AM) *
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.
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 2 2008, 02:41 PM
Post #6





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(speculatrix @ Apr 2 2008, 02:44 PM) *
QUOTE(ArchiMark @ Apr 2 2008, 04:20 AM) *
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.


Thanks for your help with this, speculatrix!!

Will report back after I try this out...

wink.gif

Go to the top of the page
 
+Quote Post
ZDevil
post Apr 3 2008, 11:10 AM
Post #7





Group: Members
Posts: 2,003
Joined: 16-April 04
From: the Netherlands && /dev/null
Member No.: 2,882



QUOTE(speculatrix @ Apr 2 2008, 11:44 PM) *
[snipped]
oh, do NOT use ext3, the journalling will kill the card faster.

This may not be true in practice, as argued in this article, which in a way also applies to CF disks: http://wiki.eeeuser.com/ssd_write_limit
And given that my Z with 16GB vs. my Eee PC with 4GB ...
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 3 2008, 02:32 PM
Post #8





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(ZDevil @ Apr 3 2008, 12:10 PM) *
QUOTE(speculatrix @ Apr 2 2008, 11:44 PM) *
[snipped]
oh, do NOT use ext3, the journalling will kill the card faster.

This may not be true in practice, as argued in this article, which in a way also applies to CF disks: http://wiki.eeeuser.com/ssd_write_limit
And given that my Z with 16GB vs. my Eee PC with 4GB ...


Thanks for that info/link....sounds reassuring as I have a feeling I won't be using my Z in 25 years....

wink.gif
Go to the top of the page
 
+Quote Post
adf
post Apr 3 2008, 10:32 PM
Post #9





Group: Members
Posts: 2,821
Joined: 13-September 04
From: Wasilla Ak.
Member No.: 4,572



QUOTE
@adf: Archimark is talking about using and A-Data card. I remember you posting about major problems getting Debian to work on your transplanted A-data card. Did you solve those problems?


No, I went to pdaxii13. I am hoping the sharpbootloader method will work, though.
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 4 2008, 10:35 AM
Post #10





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(speculatrix @ Apr 2 2008, 02:44 PM) *
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!
Go to the top of the page
 
+Quote Post
iwantprogress
post Apr 4 2008, 12:59 PM
Post #11





Group: Members
Posts: 21
Joined: 8-May 07
Member No.: 16,294



rsync also works and is faster if you need to redo.
Go to the top of the page
 
+Quote Post
speculatrix
post Apr 4 2008, 01:58 PM
Post #12





Group: Admin
Posts: 3,281
Joined: 29-July 04
From: Cambridge, England
Member No.: 4,149



QUOTE(ArchiMark @ Apr 4 2008, 07:35 PM) *
QUOTE(speculatrix @ Apr 2 2008, 02:44 PM) *
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.
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 4 2008, 03:49 PM
Post #13





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(speculatrix @ Apr 4 2008, 02:58 PM) *
QUOTE(ArchiMark @ Apr 4 2008, 07:35 PM) *
QUOTE(speculatrix @ Apr 2 2008, 02:44 PM) *
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....

smile.gif
Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 5 2008, 04:30 PM
Post #14





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



QUOTE(iwantprogress @ Apr 4 2008, 01:59 PM) *
rsync also works and is faster if you need to redo.


Thanks for your suggestion too, iwantprogress, didn't know about rsync....

Just googled it and found the rsync website....sounds interesting....

wink.gif

Go to the top of the page
 
+Quote Post
ArchiMark
post Apr 7 2008, 07:21 AM
Post #15





Group: Members
Posts: 1,026
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



OK, tried the 'cat' approach and here's what I get:

CODE
#cat /dev/hda2 > /dev/hdc1
#df
Filesystem   1K-blocks   Used                    Available  Used%      Mounted   on
/dev/hda2      5589680       1317484        3988248  25%      /
tmpfs      31180           0        31180    0%      /lib/init/rw
udev      10240         80        10160    1%      /dev
tmpfs      31180           4        31176    1%      /dev/shm
/dev/hdc1      5184312     -25616124    30516488     -     /mnt/cf1

#cd /mnt/cf1
EXT3-fs error (device hdc1): ext_readdir: bad entry in directory #2: directory
entry across blocks - offset=0, inode=4294967295, rec_len=65536, name_len=255


So, should I just try the other way or did I do something wrong???

blink.gif

Thanks!
Go to the top of the page
 
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd October 2014 - 04:27 AM