Total Pageviews

Thursday, April 12, 2012

Formatting a file system in Linux

agnel@agnel-desktop:~$ sudo fdisk -l
[sudo] password for agnel:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x21392138

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    40965749    20482843+   7  HPFS/NTFS/exFAT
/dev/sda2        40965750    82911464    20972857+  83  Linux
/dev/sda3        82911465   292623974   104856255   83  Linux
/dev/sda4       292624036   976768064   342072014+   5  Extended
/dev/sda5       292624038   397480229    52428096    7  HPFS/NTFS/exFAT
/dev/sda6       397480293   502336484    52428096    7  HPFS/NTFS/exFAT
/dev/sda7       502336548   544282199    20972826   83  Linux
/dev/sda8       544282263   586227914    20972826   83  Linux
/dev/sda9       586227978   628173629    20972826   82  Linux swap / Solaris
/dev/sda10      628173693   976768064   174297186   83  Linux

Disk /dev/sdb: 8000 MB, 8000110592 bytes
160 heads, 19 sectors/track, 5139 cylinders, total 15625216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe2b1ddc1

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          32    15625215     7812592    b  W95 FAT32
agnel@agnel-desktop:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda7             20641788   8828556  10764592  46% /
udev                   4088092         4   4088088   1% /dev
tmpfs                  1638404      1048   1637356   1% /run
none                      5120         0      5120   0% /run/lock
none                   4096008      1736   4094272   1% /run/shm
/dev/sda10           163390464 154911308   4993216  97% /FILMS
/dev/sda1             20482840   7882284  12600556  39% /C
/dev/sda6             52428092  49347808   3080284  95% /MISC
/dev/sda5             52428092  35624236  16803856  68% /TUT
/dev/sda8             19660220  13460128   5780636  70% /HOME
/dev/sda3            103210972  78500344  19467816  81% /VIRT
/dev/sdb1              7797344   2321556   5475788  30% /media/SAM
agnel@agnel-desktop:~$ sudo umount /media/SAM
agnel@agnel-desktop:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda7             20641788   8828800  10764348  46% /
udev                   4088092         4   4088088   1% /dev
tmpfs                  1638404      1048   1637356   1% /run
none                      5120         0      5120   0% /run/lock
none                   4096008      1736   4094272   1% /run/shm
/dev/sda10           163390464 154911308   4993216  97% /FILMS
/dev/sda1             20482840   7882284  12600556  39% /C
/dev/sda6             52428092  49347808   3080284  95% /MISC
/dev/sda5             52428092  35624236  16803856  68% /TUT
/dev/sda8             19660220  13460128   5780636  70% /HOME
/dev/sda3            103210972  78500344  19467816  81% /VIRT
agnel@agnel-desktop:~$ mkfs.vfat /dev/sdb1
mkfs.vfat 3.0.9 (31 Jan 2010)
/dev/sdb1: Permission denied
agnel@agnel-desktop:~$ sudo mkfs.vfat /dev/sdb1
mkfs.vfat 3.0.9 (31 Jan 2010)
agnel@agnel-desktop:~$

No comments:

Post a Comment