# [SOLVED] Cloning a OS/2 Warp PCMCIA drive

## tpheiska

The situation is as follows: I have a 170MB PCMCIA hard drive which

seems to have an OS/2 warp file system. I need to clone this drive to

a newer PCMCIA-Flash-drive before it breaks. Our company is naturally

Windows-only and they have been unable to clone the disk and so they

asked the "official Linux guy"  :Wink: 

I have a Gentoo laptop with a PCMCIA slot at home, and also Win XP

machines with PCMCIA slots at the office. My original plan was to:

1. Mount the drive with my Gentoo box,

2. clone the disk with dd,

3. mount the new flash drive,

4. copy the contents to the new drive.

Now I started to hesitate and would like some advice on my approach.

Can I clone the disk this way?Last edited by tpheiska on Wed Aug 15, 2007 7:34 am; edited 1 time in total

----------

## alex.blackbit

i would say yes. the filesystem should be HPFS. make sure you have support for it in your kernel.

mount it read-only. and try it with dd.

----------

## eccerr0r

do watch out that older filesystem/disk partition tables could be tied to the hardware and you should check to make sure the new partition is fine before claiming the job is done.

----------

## tpheiska

I got the following info from comp.os.os2.misc where Tero Kaarlela wrote:

 *Quote:*   

> 
> 
>  Should be possible that way. But skip the mounting part you dont have
> 
> to mount partitions just:
> ...

 

I just brought my gentoo laptop to the office and plugged the flash-pcmcia drive in. The following lines appeared to /var/log/messages:

 *Quote:*   

> Aug  7 07:51:36 localhost pccard: PCMCIA card inserted into slot 0
> 
> Aug  7 07:51:36 localhost pcmcia: registering new device pcmcia0.0
> 
> Aug  7 07:51:36 localhost udevd-event[6117]: match_rule: MODALIAS is deprecated, use ENV{MODALIAS} or SYSFS{modalias} instead.
> ...

 

Also a device node (sd[a/b]) does not appear.  I have previously used the PCMCIA slot for a WLAN card. Any tips on how I can get the drive to register? I have looked through the kernel options but haven't seen anything useful there. I'm using yenta-socket as my PCMCIA driver.

----------

## eccerr0r

PCMCIA HDD's usually show up as /dev/hdX like ATAPI devices.

I'm not sure if there's a libata for PCMCIA yet, but try /dev/hdeX, that's the device node my laptop tends to dump the PCMCIA hard disks to.

Did you manually eject it in 20 sec or was it automatically "ejected"?  Can you do a 'cardctl ident' with the drive inserted?

----------

## tpheiska

The last log line was created when I manually ejected the device. I confirmed the fact that indeed no device node is created to /dev/ when I instert the device. Then I did the following:

 *Quote:*   

> localhost linux # lspcmcia
> 
> Socket 0 Bridge:        [yenta_cardbus]         (bus ID: 0000:00:04.0)
> 
> Socket 1 Bridge:        [yenta_cardbus]         (bus ID: 0000:00:04.1)

 

Insert the drive.

 *Quote:*   

> localhost linux # lspcmcia
> 
> Socket 0 Bridge:        [yenta_cardbus]         (bus ID: 0000:00:04.0)
> 
> Socket 0 Device 0:      [-- no driver --]       (bus ID: 0.0)
> ...

 

Is this a kernel config problem?

----------

## eccerr0r

weird, ide-cs should be loaded when you insert the card, any indication if this disk is not a ATAPI-compatible card?

what does cardctl ident show?

----------

## tpheiska

For the flash drive: 

 *Quote:*   

> localhost devices # pccardctl ls
> 
> Socket 0 Bridge:        [yenta_cardbus]         (bus ID: 0000:00:04.0)
> 
> Socket 0 Device 0:      [-- no driver --]       (bus ID: 0.0)
> ...

 

And for the hard drive:

 *Quote:*   

> localhost devices # pccardctl ident
> 
> Socket 0:
> 
>   product info: "INTEGRAL PERIPHERALS", "ATA CARD", "", ""
> ...

 

On your question about ATAPI-compatibility, no idea so far...   :Rolling Eyes: 

----------

## tpheiska

Success!

I installed pcmcia-cs and recompiled the kernel with ide-cs option and managed to get the drives working. (I sincerely didn't know about the ide-cs option previously   :Embarassed:  ) I'm creating the disk images now, it appears that there's several partitions as i found /dev/hde and /dev/hde[1,2,5] nodes. After that I'll start on cloning the actual disk. Thank you all for helping. I'll change the topic if I manage to actually clone the disk. If not, I'll ask more questions.   :Wink: 

----------

