LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-15-2012, 03:29 PM   #1
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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.
 
Old 10-15-2012, 04:45 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
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!

Last edited by onebuck; 10-15-2012 at 04:46 PM. Reason: typo
 
Old 10-15-2012, 04:48 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Original Poster
Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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.
 
Old 10-16-2012, 03:52 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
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.
 
Old 10-16-2012, 03:41 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Original Poster
Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Thanks,

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

Last edited by jefro; 10-16-2012 at 03:49 PM.
 
Old 10-17-2012, 03:21 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Yep
 
Old 10-17-2012, 03:04 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,001

Original Poster
Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to reduce the size of a dd image file to fit onto a new smaller SSD drive bunchdaddy Linux - Desktop 3 10-06-2012 01:51 PM
Using dd and gzip to create hard drive image but image is bigger than hard drive? banz Linux - Software 3 11-22-2008 04:25 AM
Drive Failure - Restore from drive/partition image? dkuntz Linux - General 3 12-02-2006 01:35 AM
hard drive failing, how can I create an image of my drive? oily_rags SUSE / openSUSE 6 07-07-2005 02:19 PM
Creating/restoring drive image on USB drive OneSeventeen Linux - Newbie 9 07-06-2005 05:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:38 AM.

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