A task in my homework assignment asks me to create a virtual file system, mount it, and perform some operations on it.
I am supposed to create a file of 10 MB whose bits are all set to 0
, format it as ext3 and mount it. This is how I've done that:
dd if=/dev/zero of=~/filesyst bs=10485760 count=1
sudo mkfs.ext3 ~/filesyst
sudo mount –o loop ~/filesyst /media/fuse
Even though I've used /dev/zero
, the file i still full of gibberish characters (mostly at-signs). The permissions on /media/fuse
are drw-rw-rw-
(which are alright), but the permissions on the files inside it are something like this:
d????????? ? ? ? ? ? lost+found
-????????? ? ? ? ? ? secret_bin
Where have I gone wrong?
mkfs.ext3 -F ~/filesyst
bs
andcount
arguments. If I writebs=1MiB count=10
, as in that link you posted, it works.truncate -s 400m filesyst
. The difference is that until you actually write data to the file, it uses no space on the disk, so you can make a virtual filesystem that is larger than your whole disk drive, as long as you don't try to actually fill it up. You can see how much space the file is actually using withdu -h filesyst
.