|
|
Ext3 is a linux filesystem and used by most of the linux systems. This article shows and example ext3 image usage situation.
we will create and use 20MB ext3 image. 1024×20480 bytes.
first we create an empty file with dd block size 1024
dd if=/dev/zero of=disk1.image bs=1024 count=20480
then we format that image
mkfs.ext3 -F -b 1024 disk1.image 20480
this will give an empty filesystem whose type is ext3.
then we mount the image. to /tmp/image directory. Before do that please create a directory with (mkdir /tmp/image)
mount -t ext3 -o loop disk1.image /tmp/disk1
after mount operation we can add files into that image and use it with mount operation. For example
touch /tmp/disk1/testfile.txt
echo "loadyourself.com" > /tmp/disk1/testfile2.txt
Or we can write it to an usb disk with cat command.
cat disk1.image > /dev/sdb1 or cat disk1.image > /dev/sdc1
“cat disk1.image > /dev/sdb1″ this command is very dangerous please don’t use it if you don’t know which is is your main disk and which disk is your usb stick. You can erase all your hard this if you use it over your main disk.
Related posts:
- Creating a Patch File In Linux Creating a Patch File: diff -Naur olddir newdir > new-patch-file...
- How to use windows shares with Linux Samba First of all you need to share some directories on...
- Creating Assembly Code with gcc Use the -S (note: capital S) switch to GCC, and...
- Disk Usage Information The CLI way The df utility displays the disk space...
- Sample Linux Driver (module) I am generally writing linux drivers for embedded systems for...
Comments
Leave a comment Trackback