![]() ![]() |
Apr 7 2008, 07:31 AM
Post
#16
|
|
|
Group: Members Posts: 12 Joined: 30-January 08 Member No.: 21,303 |
Cat gives same results as dd - won't work unless devices are the same or close enough
Use the tar method! |
|
|
|
Apr 7 2008, 07:32 AM
Post
#17
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
given that the cards are different sizes and therefore your partitioning needs to be different, you're going to run into a world of pain copying the card raw block style; just use "fdisk" to partition the target, "mkfs.ext2 /dev/X" to format it, then mount and copy files. really, it's actually not hard :-)
|
|
|
|
Apr 7 2008, 07:36 AM
Post
#18
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
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. Just to clarify, in looking at the above, shouldn't the first 'tar' above be for the 'hda2' partition, not 'cf' as shown?? In other words, shouldn't the above look like this? CODE #cd / #tar / - . | (cd /mnt/cf1; tar xf - ) Thanks! |
|
|
|
Apr 7 2008, 07:41 AM
Post
#19
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
given that the cards are different sizes and therefore your partitioning needs to be different, you're going to run into a world of pain copying the card raw block style; just use "fdisk" to partition the target, "mkfs.ext2 /dev/X" to format it, then mount and copy files. really, it's actually not hard :-) I did format partition after I created it, speculatrix....so that's already done... As for copying files, I can do that, just assumed that this might not work as when you try to do that with a Windoze install...it won't make for a bootable drive, you have to use a cloning app in order to get an exact duplicate of drive that boots.... So, if Linux is different than Windoze in this regard, then no problem, I'll just copy the directories over to the CF card.... Hope this makes sense.... This post has been edited by ArchiMark: Apr 7 2008, 07:59 AM |
|
|
|
Apr 7 2008, 08:08 AM
Post
#20
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
"tar cf" is the command, "c" means create, "f" means the next argument is the output file (- means use stdout). "tar xf" means extract with source being stdin.
if you're copying the root partition, you will need to exclude the target mount point, eg. cd / tar cf - . --exclude=/mnt/newdir | ( cd /mnt/newdir ; tar xf - ) |
|
|
|
Apr 7 2008, 08:10 AM
Post
#21
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
p.s. if you're copying with tar, the target disk/partition needs to be formatted and mounted in advance.
if you're cloning with cat or dd, the partition should NOT be mounted at the time. |
|
|
|
Apr 7 2008, 08:34 AM
Post
#22
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
"tar cf" is the command, "c" means create, "f" means the next argument is the output file (- means use stdout). "tar xf" means extract with source being stdin. if you're copying the root partition, you will need to exclude the target mount point, eg. cd / tar cf - . --exclude=/mnt/newdir | ( cd /mnt/newdir ; tar xf - ) I get it now, speculatrix!!!....I thought that the 'cf' there was referencing 'cf' as in 'compact flash'...... p.s. if you're copying with tar, the target disk/partition needs to be formatted and mounted in advance. if you're cloning with cat or dd, the partition should NOT be mounted at the time. Thanks for clarifying that....so, I did the clone with 'cat' wrong as I had mounted the partition I think.... Meanwhile, I'm just copying over directories to CF card now.... |
|
|
|
Apr 7 2008, 09:21 AM
Post
#23
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
Copying over directories...most copying over OK, but have had a few error messages:
CODE #cp -r /proc /mnt/cf1 Warning: /proc/ide/hd?/settings interface is obsolete, and will be removed soon! cp: cannot open `/proc/sys/net/ipv4/route/flush' for reading: Permission denied cp: cannot open `/proc/sys/net/ipv6/route/flush' for reading: Permission denied process `cp' is using deprecated sysctl (syscall) net.ipv6.neigh.default.retrans_time: Use net.ipv6.neigh.retrans_time_ms instead. cp: reading `/proc/sysrg-trigger': Input/output error No more HD green light activity showing and command prompt has not returned after 10 minutes... ???? Thanks! |
|
|
|
Apr 7 2008, 11:30 AM
Post
#24
|
|
|
Group: Members Posts: 12 Joined: 30-January 08 Member No.: 21,303 |
The stuff in /proc you needn't worry about, it's auto generated by the kernel
|
|
|
|
Apr 7 2008, 11:40 AM
Post
#25
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
ooops, yes, exclude /proc and /sys too. probably not a bad idea to clean out /tmp too.
|
|
|
|
Apr 7 2008, 06:32 PM
Post
#26
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
Thanks for the advice, rogalian & speculatrix!
|
|
|
|
Apr 8 2008, 12:52 PM
Post
#27
|
|
![]() Group: Admin Posts: 3,277 Joined: 29-July 04 From: Cambridge, England Member No.: 4,149 |
let us know when you're back up and running.
|
|
|
|
Apr 8 2008, 07:18 PM
Post
#28
|
|
![]() Group: Members Posts: 975 Joined: 25-June 03 From: Silicon Valley Member No.: 208 |
let us know when you're back up and running. Thanks speculatrix..... Meanwhile, copied over directories, cleaned out 'tmp'..... Just did 'df' and here's what I see: CODE Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda2 5589680 1317404 3988328 25% / tmpfs 31180 0 31180 0% /lib/init/rw udev 10240 80 10160 1% /dev tmpfs 31180 4 31176 1% /dev/shm /dev/hdc1 5589680 2419708 2886024 46% /mnt/cf1 So......why does my existing microdrive with Debian EABI only use 25% of the drive and the new 32GB CF card use 46% of drive??? Maybe I'm just being overly cautious with all of this...but I'm trying to avoid situation where I yank out microdrive, take apart my Z and install CF card, put Z back together, and voila! it doesn't boot up or something like that.... Thanks! |
|
|
|
Apr 9 2008, 01:08 AM
Post
#29
|
|
|
Group: Members Posts: 39 Joined: 9-April 04 Member No.: 2,752 |
I had to do something similar last night, when I managed to make my 16gb CF unbootable, fortunately i had my 4gb I was using until about 1 month ago :-
1) Attached 4gb microdrive to laptop using USB adapter, checked the filesystem (just to be safe). 2) Mount 4gb microdrive (/media/disk in this case) 3) cd /media/disk 4) copy contents to laptop HD (I wanted a) a backup mkdir /home/andy/z/cf_recovery find . | cpio -pdmv /home/andy/z/cf_recovery 5) wait ....... 6) once the copy was complete umount /media/disk 7) Disassemble Z (c3100 in my case) 9) Retrieve CF card from Z, attach to lappy via USB. 10) It automounted on /media/disk, so I unmounted it. 11) Create an ext2 filesystem (yes I want ext3 journaling, but i am going to dump a lot of data in a stable environment so I don't need the journal - it would only slow things down). mke2fs /dev/hdb1 tune2fs -i 0 -c 0 /dev/hda1 (turns off fsck after a number of mounts). 12) mount the cf card (mount /dev/hdb1 /media/disk) 13) cd /home/andy/z/cf_recovery 13) find . | cpio -pdmv /media/disk 14) wait ..... 15) umount cf card, insert in Z, rebuild Z - hey presto - working fs BTW. If you need to repeat step 13) for any reason either remake the filesystem or add the 'u' flag (unconditional overwrite) to the cpio. Hope this helps ajnk (Then I did an apt-get update ; apt-get upgrade ) |
|
|
|
Apr 9 2008, 04:19 AM
Post
#30
|
|
|
Group: Members Posts: 2,003 Joined: 16-April 04 From: the Netherlands && /dev/null Member No.: 2,882 |
Good to know that things are working now.
ajnk: so do you mean the latest yonggun kernel can boot off an ext2 partition? I remember the previous one only takes ext3 ... |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 06:18 AM |