{"revision": {"id": "f3c85cdc-2f95-11f1-ad35-e86a64d24d78", "node_id": "f3c75666-2f95-11f1-9dcc-e86a64d24d78", "user_id": "edc3f576-2f95-11f1-900f-e86a64d24d78", "author": "foxhop", "data": "Linux Raw File system Management\r\n###########################################\r\n\r\nPretend we have added a new disk to our computer.\r\n\r\nThe operating system has detected this new disk as device /dev/xvdf.\r\n\r\nThe following documents the steps we need to take to use this new space.\r\n\r\nPartition the device\r\n========================\r\n\r\nYou may cut the device into separate logical disks.\r\n\r\nIn my case I want to use the whole disk\r\n\r\n.. code-block:: bash\r\n\r\n sudo fdisk /dev/xvdf \r\n # choose needed settings\r\n\r\nFormat the partition with a filesystem\r\n========================================\r\n\r\nWe want to use ext4 so we do\r\n\r\n.. code-block:: bash\r\n\r\n sudo mkfs.ext4 /dev/xvdf\r\n\r\n  mke2fs 1.42 (29-Nov-2011)\r\n  Filesystem label=\r\n  OS type: Linux\r\n  Block size=4096 (log=2)\r\n  Fragment size=4096 (log=2)\r\n  Stride=0 blocks, Stripe width=0 blocks\r\n  6553600 inodes, 26214400 blocks\r\n  1310720 blocks (5.00%) reserved for the super user\r\n  First data block=0\r\n  Maximum filesystem blocks=4294967296\r\n  800 block groups\r\n  32768 blocks per group, 32768 fragments per group\r\n  8192 inodes per group\r\n  Superblock backups stored on blocks: \r\n         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, \r\n         4096000, 7962624, 11239424, 20480000, 23887872  \r\n\r\n  Allocating group tables: done                            \r\n  Writing inode tables: done                            \r\n  Creating journal (32768 blocks): done\r\n  Writing superblocks and filesystem accounting information: done   \r\n\r\n\r\n\r\nMount and test the new filesystem\r\n=======================================\r\n\r\n\r\n.. code-block:: bash\r\n\r\n sudo mount /dev/xvdf1 /mnt\r\n touch /mnt/testfile\r\n ls /mnt\r\n sudo umount /mnt\r\n ls /mnt\r\n sudo mount /dev/xvdf1 /mnt\r\n\r\n\r\nAutomatically mount partition at system boot\r\n=================================================\r\n\r\nAdd an entry into /etc/fstab for new partition.\r\n\r\n.. code-block:: text\r\n\r\n /dev/xvdf1   /mnt        ext4   defaults        0 0\r\n\r\n\r\n\r\n\r\n", "source_format": "rst", "revision_number": 5, "created": 1360531861000}}