How to create FS image and mount
Hi,
How to create the FS image and mount the same ..? I need to store some data in the image which I'll be creating ..? |
create a file-system image?
you can look into: Code:
dd if=/dev/your-device of=~/Desktop/your-device-image.img http://www.andremiller.net/content/m...ns-using-linux with regards, www.brainpowered.net |
To craete a new file-system image you have to first create a new container for that image, for example an image which is 1000 MB in size:
Code:
dd if=/dev/zero of=~/myimage bs=1M count=1000 Code:
mkfs -t ext4 ~/myimage Code:
mount -o loop ~/myimage /mnt/tmp |
Hi,
Thanks for the reply , I could create the image , now How to put data in to that .? |
If you have mounted the image, in my example at /mnt/tmp, you can simply copy data into it, using the commandline or a graphical file-manager. If your work is done you can simply unmout the image
Code:
umount /mnt/tmp |
Hi,
I cloud create this , But How to write this using 'C' code , |
i love question are clear from the start..
|
Hi,
Now I have written C code which acquire the data but I dont know how to run the terminal command from the C code to create the FS image or copy the data to created Image . how to do this ..? |
Quote:
Popen executes a shell command and returns a pointer to it's I/O stream. http://pubs.opengroup.org/onlinepubs...ons/popen.html |
All times are GMT -5. The time now is 01:08 PM. |