lab9 Filesystem
  • Introduction
  • Important Commands
    • File Permissions
    • Disk Duplication
    • Create FAT Filesystems
    • Check and Repair FAT filesystem
    • Mount
    • Demo
    • Viewing with Hex Editor
      • Endian-ness in FAT32
  • Linux File System Calls
  • Directory Related Calls in C Language
  • Overview of FAT32
  • Accessing FAT using C
    • C Header of FAT
      • Header: Boot Sector
      • Header: Dir Entry
      • Read the header
    • 8+3 File Name
    • Traversing Cluster
    • Finding Next Cluster
    • Reference
Powered by GitBook
On this page

Was this helpful?

  1. Important Commands

Disk Duplication

PreviousFile PermissionsNextCreate FAT Filesystems

Last updated 5 years ago

Was this helpful?

ddis a command for low-level copying. As the disks on *nix platform are represented like normal files, so dd can take input from/output to these devices. We can also use dd to create a virtual disk.

To begin with, let 's try the following command:

sudo dd if=FILE of=FILE bs=BYTES count=BLOCKS

ddtakes few arguments:

  • if

    : Input file FILE (e.g., /dev/zero,/dev/urandom)

  • of

    : Output file FILE

  • bs

    : Block size: read and write BYTES bytes at a time.

  • count

    : copy only BLOCKS input blocks.

Example

Now we wish to create a file with zeros about 64MB

$ dd if=/dev/zero of=test.disk bs=64M count=1

After that, you can see the result showing:

PLEASE BE CAREFUL – dd is often nicknamed disk destroyer because it will happily overwrite any data you tell it to, including the stuff you wanted to keep if you make a mistake typing the command!