LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Raw drive image change drive size in image? (https://www.linuxquestions.org/questions/linux-general-1/raw-drive-image-change-drive-size-in-image-4175432354/)

jefro 10-15-2012 03:29 PM

Raw drive image change drive size in image?
 
We have some very old qnx systems that we fix by basically dd image to new drives. The original partition was only 240mb. As time goes on we can't get 240mb drives so the image keeps getting larger. We now have 32G drives and the image just takes forever.

In qemu I can play with the raw image just as if it were a real drive with the exception of using the old qnx_drive_clone script. Dunno why that never works.

How can I take one of the images and grab the 240mb partition out to a smaller drive image or change the drive image parameters to a smaller drive and cut out the extra space?

I know this isn't linux directly but the concepts of drive management on image should be the same.

Thanks.

onebuck 10-15-2012 04:45 PM

Member Response
 
Hi,

Instead of 'dd' why not use parted, clonezilla or some partition tool to copy the 240MB image to another partition of the same size on the new drive. Look at: List of disk cloning software 'This list of software works with Windows, Mac, and Linux (or can be used from a Live CD).

SystemRescueCd is a Linux system on a bootable CD-ROM for repairing your system and recovering your data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the partitions of the hard disk. It contains a lot of system utilities (parted, partimage, fstools, ...) and basic tools (editors, midnight commander, network tools). + 'Online-Manual

PartImage is on the above CD.

clonezilla.org would be a good site to check out.

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!

jefro 10-15-2012 04:48 PM

Thanks for the reply.

All those tools need to be able to write to a QNX4 format and unless I am wrong, they won't. I did try gparted and it thinks it is a fat partition and creates the new partition but fails on write.

syg00 10-16-2012 03:52 AM

Make a 250 Meg target partition (just to be safe), and just "dd" that amount (using count).
Should get you the filesystem, plus a bit of slack in that partition, but in future just copy that (new) partition - after preallocating a 250 Meg partition of course.

jefro 10-16-2012 03:41 PM

Thanks,

I didn't think about that. Lemme try it. Blocksize and count?

syg00 10-17-2012 03:21 AM

Yep

jefro 10-17-2012 03:04 PM

Still driving me nuts. Tried bs=240M count=1 and many other ways of calculation but it must be some issue with QNX. Good news is it seems to fail mostly with same results. I have an old original image and I guess I can rebuild it with the correct files maybe.

QNX had a script that seems like it should have worked and some other forum posts had similar ways to us cp or cat but the all fail too.

I might go back the the manipulation of the drive parameters.

Wonder if qemu has anything to do with the thing failing?


All times are GMT -5. The time now is 12:20 PM.