LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2015, 04:20 PM   #16
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0

Quote:
Originally Posted by jefro View Post
Lets start all over.
This media if we can assume it really is bootable should be able to be copied by dd to a file. I doubt it would be sda but I don't get your wrong OS issue.
It's not really sda, both cards read in as /dev/sdf; just used sda/sdb as examples.

Also, when I said "When inserted into my diagnostic device, the card makes it boot a different OS," I'm just trying to describe what the card does. Instead of the normal OS of my device, the intended purpose of the card is to make it boot to a different one.

Quote:
Originally Posted by jefro View Post
Once you have it do a file you should be able to test it on qemu. I suspect this is a pretty old distro. It was very difficult for any pcmcia to boot on linux. It only had minimal support for a few years. I'd copy this distro off to an image and see if you can boot it on qemu.

Cool, thanks for the lead on qemu-- will try.
 
Old 04-16-2015, 10:40 PM   #17
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
OK, I haven't been able to get even the original card to boot through qemu, after going through quite a few configuration options (DOS, old processors, as barebones as possible). So maybe it's not exactly a standalone OS, i.e. it's loaded on top of the device's OS?

Btw, the output of
Code:
file -k disk.bin
is
disk.bin: x86 boot sector, code offset 0x3c, OEM-ID "DXA2.00 ", sectors/cluster 4, root entries 512, sectors 62592 (volumes <=32 MB) , Media descriptor 0xf8, sectors/FAT 62, heads 64, serial number 0x1535164, label: " X CARD", FAT (16 bit) DOS executable (COM), boot code
Another weird thing: When I compare the images of
Code:
dd if=/dev/sdf of=disk.bin
and
Code:
dd if=/dev/sdf of=disk_bs1.bin bs=1
by using
Code:
diff disk.bin disk_bs1.bin
The output says "disk.bin and disk_bs1.bin differ." What?!? Either way, the bs=1 version does not work either.

I also tried clonezilla, but it gave some error about not recognizing the partition type....

Last edited by grant or not; 04-16-2015 at 10:42 PM.
 
Old 04-17-2015, 04:33 AM   #18
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,633

Rep: Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391Reputation: 2391
Wow! this is a popular thread.

When you copy with dd you get a copy of the block, complete with a matching directory structure. When you copy on to a non identical disk, the cyls/heads/sectors emulation does not reliably transfer to a different size disk. That's what I was trying to say in post #2

From your latest post, the '64 heads' buried in the file-k output indicates to me that this thing has an older than current method of disk access.

Rsync or cp -a both copy files, not directory structures. You would then have to make the new disk bootable. But as you don't seem to know what the disk contains yet, I will leave that to the other contributors.
 
Old 04-17-2015, 10:35 AM   #19
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by business_kid View Post
When you copy with dd you get a copy of the block, complete with a matching directory structure. When you copy on to a non identical disk, the cyls/heads/sectors emulation does not reliably transfer to a different size disk.

From your latest post, the '64 heads' buried in the file-k output indicates to me that this thing has an older than current method of disk access.
Interesting. I always thought cyls/heads/sectors was just antiquated nomenclature and that really it's just a string of bytes, especially in a flash card. But if there are differences in how it's all emulated across architectures, then the file intermediate written onto my hard disk platter could definitely be the problem. That might explain the difference between the bs=512 and bs=1 image, no? Btw, I dont' know if it makes a difference, but there are no directories in the card, just a couple files.

Quote:
Originally Posted by business_kid View Post

Rsync or cp -a both copy files, not directory structures. You would then have to make the new disk bootable. But as you don't seem to know what the disk contains yet, I will leave that to the other contributors.
I did try to dd the first 512 bytes, and then cp the files over, to no avail... part of the reason I originally wondered if this thing has some nonstandard MBR size. I'm definitely going to need the card's original MBR.

Last edited by grant or not; 04-17-2015 at 10:37 AM.
 
Old 04-17-2015, 10:39 AM   #20
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Is this from a set top box? Are you trying to copy something you're not supposed to copy?
 
Old 04-17-2015, 10:49 AM   #21
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
No, the card and device are no longer sold, I'm just trying to back up my card.
 
Old 04-17-2015, 03:08 PM   #22
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,046

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Not easy to get card to boot on qemu. Was supposed to test dd file in qemu.

Is this linux or some other OS? What is this pcmcia card anyway? We have to assume that it is an old 5V card and your adapter ought to be able to provide this voltage.

Is this a cisco card?
 
Old 04-17-2015, 03:16 PM   #23
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jefro View Post
Not easy to get card to boot on qemu. Was supposed to test dd file in qemu.

Is this linux or some other OS? What is this pcmcia card anyway? We have to assume that it is an old 5V card and your adapter ought to be able to provide this voltage.
I tested both the dd image and the card directly. Used qemu in winXP because I couldn't install in Linux (long story). But if 1) it's hard to boot PCMCIA directly and 2) the image on my HDD is off (because of what business_kid mentions), then I'll have trouble with both ways.

The dd was done in Ubuntu 11.04. The original card is a bootable type II 16 bit PCMCIA card for a diagnostic machine. The target card I'm trying to clone to is a Compact Flash card with a type II PCMCIA adapter, and I read that they're straight adapters without compatibility issues. If I can't get it to work, the next try will be a 32mb (correct size) PCMCIA flash card.
 
Old 04-21-2015, 06:07 PM   #24
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
I just tried a 32mb (correct size) PCMCIA card (correct format). No go. I really can't understand it.

I didn't try directly from PCMCIA to PCMCIA slot, but after thinking about it more it doesn't seem like it would make a difference. Or would it?

Anything else I can try? Any flags I should throw to dd? When I did a hexdump on the MBR, I noticed it's just a few characters identifying the card, followed by mostly zeros in the bootstrap code area, and then ending with the boot signature. Something tricky is going on but I don't know what.....
 
Old 04-22-2015, 06:40 AM   #25
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Buy or borrow another card reader/writer and try this process directly from card to card.
 
Old 04-23-2015, 10:02 PM   #26
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rtmistler View Post
Buy or borrow another card reader/writer and try this process directly from card to card.
Unfortunately it didn't work going from one PCMCIA drive to another.

Are there hidden partitions or something I'm not taking into consideration??

One thing I noticed is, the original card is Hitachi and reports 32,047,104 bytes, while the target card is Samsung and is 32,112,640 bytes. There don't appear to be Hitachi PCMCIA cards for sale, but there are CF cards. Maybe it's worth trying one?

Also meant to ask: is it worth trying to spoof the original serial number? What other things could make a device picky about a disk???

This backup is approaching the cost of the original card itself, but now I'm just feeling stubborn about the whole thing.

Will try any and all suggestions, thanks.

Last edited by grant or not; 04-23-2015 at 10:08 PM.
 
Old 04-23-2015, 10:20 PM   #27
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
and just to note, I also tried

Code:
dd if=/dev/sdf of=/dev/sdg iflag=direct oflag=direct
to avoid system caching of the data stream....
 
Old 04-24-2015, 12:20 PM   #28
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Quote:
Originally Posted by grant or not View Post
and just to note, I also tried

Code:
dd if=/dev/sdf of=/dev/sdg iflag=direct oflag=direct
to avoid system caching of the data stream....
Did that complete without any errors? Did it say the exact same number of bytes out as in?

I'm really out of ideas. Dd is 100% bit copy. But also bit copy of the available/visible space. If the original card does have a non-visible to normal file systems section, but one that is visible just to that product, then you can't copy. However I believe you said you were able to do a copy before, right?

And with the target size being slightly larger than the source, this should've worked. The problems I was citing would be the reverse where the target is a few bytes slightly smaller than the source.
 
Old 04-24-2015, 12:31 PM   #29
grant or not
Member
 
Registered: Nov 2004
Posts: 31

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rtmistler View Post
Did that complete without any errors? Did it say the exact same number of bytes out as in?
Yep!

Quote:
Originally Posted by rtmistler View Post
However I believe you said you were able to do a copy before, right?
nope, never have before.

Quote:
Originally Posted by rtmistler View Post
If the original card does have a non-visible to normal file systems section, but one that is visible just to that product, then you can't copy.
This is what I was wondering about. There's no way to scan for something like this, eh?
 
Old 04-24-2015, 12:40 PM   #30
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,890
Blog Entries: 13

Rep: Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934Reputation: 4934
Quote:
Originally Posted by grant or not View Post
This is what I was wondering about. There's no way to scan for something like this, eh?
I would say in the case I'm thinking about, "no" because it would be an electrical thing or identity which lies outside of the available file system. For instance, jumper zero ohm resisters which indicate some settings. Not saying you should look for them either, just a possible guess. I'd say the only real way to know would be to teardown the working card and examine it's circuitry. Thereby making it a non-working card. So ... no don't do that.
 
  


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
Linux Boot disk won't start - after cloning the drive in Windows 8 clueless1 Linux - Newbie 1 03-19-2014 09:47 AM
Boot time kernel panic after cloning distro to differnt disk linux_marine Linux - Newbie 3 06-19-2007 10:46 AM
Boot time kernel panic after cloning distro to differnt disk linux_marine Mandriva 3 06-16-2007 01:38 PM
Cloning boot disk using DD vanibhat Linux - Hardware 3 12-01-2004 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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