View previous topic :: View next topic |
Author |
Message |
drseergio Apprentice
Joined: 28 Sep 2005 Posts: 236
|
Posted: Sat Feb 24, 2007 9:37 pm Post subject: Growing dd images (not file systems in them) [SOLVED] |
|
|
Is it possible to grow the size of a particular image made by dd?
Last edited by drseergio on Sun Feb 25, 2007 11:52 am; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54317 Location: 56N 3W
|
Posted: Sat Feb 24, 2007 9:57 pm Post subject: |
|
|
drseergio,
What do you want to achieve ? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
timeBandit Bodhisattva
Joined: 31 Dec 2004 Posts: 2719 Location: here, there or in transit
|
Posted: Sat Feb 24, 2007 11:26 pm Post subject: |
|
|
If you simply want to pad an image file with nulls, use dd again to read from /dev/zero and append the output to your image file. Suppose I want to pad a MemTest86+ image file to the full size of a 720Kb floppy diskette. (I happen to have these example files lying around. ) It goes like so:
Example: | ron@rockchuck /home/vmware $ ll -G [dm]*.img
-rw-r----- 1 ron 737280 2006-07-08 02:33 dos5upgrade-disk1.img
-rw-r----- 1 ron 94356 2004-11-12 11:21 memtest86.img
ron@rockchuck /home/vmware $ cd /tmp; cp /home/vmware/memtest86.img .
ron@rockchuck /tmp $ dd if=/dev/zero bs=1 count=$((737280 - 94356)) >>memtest86.img
642924+0 records in
642924+0 records out
642924 bytes (643 kB) copied, 0.850973 s, 756 kB/s
ron@rockchuck /tmp $ ll -G mem*
-rw-r----- 1 ron 737280 2007-02-24 18:17 memtest86.img |
As I assume you understand from the subject of your post, this will not grow a filesystem image to include new space. If you pad such an image, it's just padding: the image is physically larger, but the filesystem within remains the same size. _________________ Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others. |
|
Back to top |
|
|
drseergio Apprentice
Joined: 28 Sep 2005 Posts: 236
|
Posted: Sun Feb 25, 2007 11:40 am Post subject: |
|
|
Thanks for the reply. I am using an image for qemu (not dynamic COW) and thought about resizing. After the resize of the image it might be possible to grow the partition by using the guest OS, or not... I will check it. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54317 Location: 56N 3W
|
Posted: Sun Feb 25, 2007 11:44 am Post subject: |
|
|
drseergio,
Thats possible for some guest and filesystem types.
Do you actually need a single filesystem ?
You may be able to make another file for the guest and mount it at another location. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|