LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2011, 08:47 AM   #1
tr1ck
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
Boot image


Hey guys,

I'm trying to update a couple of files on a boot image that we use to run a low form of linux on some boards for testing. We basically install the image to create a bootable sdcard with this low form of linux.
Anyway I have a final.image.dd file that I usually create the sdcards from, but i need to edit the interfaces and replace a file from inside the .dd image.
Any pointers on how this could be done?

Thank you.

P.S. I'm using Ubuntu on the machine I'm doing all of this on.
 
Old 12-07-2011, 09:37 AM   #2
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

Rep: Reputation: 36
Is there any problem mounting that image to a directory and modifying the contents?
 
Old 12-07-2011, 09:38 AM   #3
tr1ck
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I can mount the image on a sdcard and modify the content there, but how do i rip the card to create a new image? i have to do a lot of these cards and we have to give the image to a supplier so they can do this for us, so i need to make the image with the settings that we need.
 
Old 12-07-2011, 10:22 AM   #4
coolsg5636
Member
 
Registered: Sep 2011
Location: Pune,India
Distribution: RHEL ,CentOS, Fedora
Posts: 100

Rep: Reputation: 25
I think you can use dd command to achieve that goal.

Here is post which will help you learn how to use "dd" command.

http://www.linuxquestions.org/questi...ommand-362506/
 
Old 12-07-2011, 10:50 AM   #5
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

Rep: Reputation: 36
I was talking about mounting "the image" not tranferring the image to a card and conecting that card.

If you have a whatever.img, which once was a fs in your card and you have created the image (using dd for instance) you should be able to mount your whatever.img in your /mnt directory. Any change you do there (if you mount your image with write permissions) will be kept in the image once you unmount it.
 
Old 12-07-2011, 11:31 AM   #6
tr1ck
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
I'm trying to.. but i get this:

Code:
root@ubuntu:/home/alex/Desktop/Tech CIP# parted -Tech.final.image.dd unit B print
Model:  (file)
Disk /home/alex/Desktop/Tech CIP/-Tech.final.image.dd: 2090860544B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start     End         Size        Type     File system  Flags
 1      16384B    1572863B    1556480B    primary
 2      1572864B  2621439B    1048576B    primary  ext2
 3      4980736B  287047679B  282066944B  primary  ext3

root@ubuntu:/home/alex/Desktop/Tech CIP# sudo mount -o loop,offset=1572864B -Tech.final.image.dd /tmp/fti
mount: invalid offset '1572864B' specified
root@ubuntu:/home/alex/Desktop/Tech CIP#

Last edited by tr1ck; 12-07-2011 at 12:33 PM.
 
Old 12-07-2011, 12:15 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Try it without the B on the end of the offset, that should work.
 
1 members found this post helpful.
Old 12-07-2011, 12:19 PM   #8
tr1ck
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
That worked, how do I save the .dd file after I'm done editing it?
 
Old 12-07-2011, 12:31 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Just unmount it. All edits are realtime, so be sure to have a backup of the image in case anything gets wrong.
 
1 members found this post helpful.
Old 12-07-2011, 12:32 PM   #10
tr1ck
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Creating a HDD boot image from a ISO boot image Basher52 Linux - Software 5 12-02-2011 05:01 PM
When I boot with PXE Boot into openSuse, error says 'invalid or corrupt kernel image' rfelsburg SUSE / openSUSE 0 05-13-2010 09:51 PM
Which boot disk image should I use to boot an external hard drive? dublinus Linux - Laptop and Netbook 8 09-29-2008 02:32 AM
Adding boot image to Ultimate Boot CD ZaphyR Linux - General 7 01-20-2005 04:08 PM
Setting X boot image, and loading image untwisted Linux - General 2 03-09-2004 08:40 PM


All times are GMT -5. The time now is 10:22 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration