Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Growing dd images (not file systems in them) [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
drseergio
Apprentice
Apprentice


Joined: 28 Sep 2005
Posts: 236

PostPosted: Sat Feb 24, 2007 9:37 pm    Post subject: Growing dd images (not file systems in them) [SOLVED] Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Sat Feb 24, 2007 9:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Sat Feb 24, 2007 11:26 pm    Post subject: Reply with quote

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. :wink:) 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
View user's profile Send private message
drseergio
Apprentice
Apprentice


Joined: 28 Sep 2005
Posts: 236

PostPosted: Sun Feb 25, 2007 11:40 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Sun Feb 25, 2007 11:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum