File System

File System


  • Create a file of 100M containing all zeros using the dd command. Call this file dsk.img
  • Associate a loopback device with the file
  • Create a VFAT file system on the new device using the mkfs command
  • Mount the new file system on /mnt/f1
  • Create a text file abc.txt in the file system mounted on /mnt/f1. The text file should contain the text "Hello SCS1214"
  • Unmount the file system on /mnt/f1
  • Use the grep command to look for the string "SCS1214" in ask.img
  • Some Info: http://wiki.osdev.org/Loopback_Device

Commands:

ubuntu@ubuntu:~$ sudo dd if=/dev/zero of=dsk.img bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.559315 s, 187 MB/s
ubuntu@ubuntu:~$ sudo losetup -f
/dev/loop9
ubuntu@ubuntu:~$ sudo losetup /dev/loop28 dsk.img
ubuntu@ubuntu:~$ sudo mkfs -t vfat /dev/loop28
mkfs.fat 4.1 (2017-01-24)
ubuntu@ubuntu:~$ sudo mkdir /mnt/f1
ubuntu@ubuntu:~$ sudo mount -t vfat /dev/loop28 /mnt/f1
ubuntu@ubuntu:~$ cd /mnt/f1
ubuntu@ubuntu:/mnt/f1$ sudo nano abc.txt
ubuntu@ubuntu:/mnt/f1$ ./
bash: ./: Is a directory
ubuntu@ubuntu:/mnt/f1$ cd /
ubuntu@ubuntu:/$ sudo umount mnt/f1

Comments

Popular posts from this blog

Programming Using GNU Octave

Library Problem

What Is A Gamma Ray Burst?