ファイルシステムの作成

パーティション操作(fdisk)
# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x9c3c6c1f.

コマンド (m でヘルプ): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
パーティション番号 (1-4, default 1):
最初 sector (2048-10485759, 初期値 2048):
初期値 2048 を使います
Last sector, +sectors or +size{K,M,G} (2048-10485759, 初期値 10485759): 5200000
Partition 1 of type Linux and of size 2.5 GiB is set

コマンド (m でヘルプ): p

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x9c3c6c1f

デバイス ブート      始点	 終点	  ブロック   Id  システム
/dev/sdb1	     2048     5200000	  2598976+  83	Linux

コマンド (m でヘルプ): d
Selected partition 1
Partition 1 is deleted

コマンド (m でヘルプ): p

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x9c3c6c1f

デバイス ブート      始点	 終点	  ブロック   Id  システム

コマンド (m でヘルプ): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
パーティション番号 (1-4, default 1):
最初 sector (2048-10485759, 初期値 2048):
初期値 2048 を使います
Last sector, +sectors or +size{K,M,G} (2048-10485759, 初期値 10485759): 5240000
Partition 1 of type Linux and of size 2.5 GiB is set

コマンド (m でヘルプ): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
パーティション番号 (2-4, default 2):
最初 sector (5240001-10485759, 初期値 5240832):
初期値 5240832 を使います
Last sector, +sectors or +size{K,M,G} (5240832-10485759, 初期値 10485759):
初期値 10485759 を使います
Partition 2 of type Linux and of size 2.5 GiB is set

コマンド (m でヘルプ): p

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
Disk label type: dos
ディスク識別子: 0x9c3c6c1f

デバイス ブート      始点	 終点	  ブロック   Id  システム
/dev/sdb1	     2048     5240000	  2618976+  83	Linux
/dev/sdb2	  5240832    10485759	  2622464   83	Linux

コマンド (m でヘルプ): w
パーティションテーブルは変更されました!

ioctl() を呼び出してパーティションテーブルを再読込みします。
ディスクを同期しています。
# partprobe /dev/sdb
ファイルシステム作成(ext3)
# mkfs -t ext3 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
163840 inodes, 654744 blocks
32737 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=671088640
20 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done0
Writing inode tables: done0
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done0

# mkdir /work
# mount /dev/sdb1 /work
# df -h /work
ファイルシス   サイズ  使用  残り 使用% マウント位置
/dev/sdb1	 2.4G  3.9M  2.3G    1% /work
# exit
ファイルシステム作成(ext4)
# mkfs -t ext4 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 510976 blocks
25548 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=34078720
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks:
	8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Allocating group tables: done3
Writing inode tables: done3
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done3
ファイルシステム作成(xfs,btrfs)
# mkfs.xfs  -f /dev/sdb1
meta-data=/dev/sdb1		 isize=512    agcount=4, agsize=31936 blks
	 =			 sectsz=512   attr=2, projid32bit=1
	 =			 crc=1	      finobt=0, sparse=0
data	 =			 bsize=4096   blocks=127744, imaxpct=25
	 =			 sunit=0      swidth=0 blks
naming	 =version 2		 bsize=4096   ascii-ci=0 ftype=1
log	 =internal log		 bsize=4096   blocks=855, version=2
	 =			 sectsz=512   sunit=0 blks, lazy-count=1
realtime =none			 extsz=4096   blocks=0, rtextents=0

# mkfs.btrfs -f /dev/sdb1
btrfs-progs v4.9.1
See http://btrfs.wiki.kernel.org for more information.

Label:		    (null)
UUID:		    35e435b9-2c48-4baf-9c97-08933be33d61
Node size:	    16384
Sector size:	    4096
Filesystem size:    499.00MiB
Block group profiles:
  Data:		    single	      8.00MiB
  Metadata:	    DUP		     32.00MiB
  System:	    DUP		      8.00MiB
SSD detected:	    no
Incompat features:  extref, skinny-metadata
Number of devices:  1
Devices:
   ID	     SIZE  PATH
    1	499.00MiB  /dev/sdb1
# なんとなく「終わった感」がないが、これで終了
- [ UP ]