| I. View newly added disks |
| [[email protected]/]# fdisk-l disk/dev/sda:53.7 GB, 53687091200 bytes, 104.8576 million sectors units = Sector of 1 * 512 = 5 Bytes sector size (logical/Physical): 512 Bytes/512 bytes I/o size (min/best): 512 Bytes/512 bytes disk label type: DOS disk identifier:0x0009f1d1 device boot start end blocks id system/dev/sda1 * 2048 1026047 512000 83 linux/dev/sda2 1026048 5253119 2113536 82 Linux swap/solaris/dev/sda3 5253120 104857599 49802240 83 linux disk/dev/sdb:21.5 GB, 21474836480 bytes, 41,943,040 Sectors units = Sector of 1 * 512 bytes sector size (logical/Physical): 512 Bytes/512 bytes I/o size (min/best): BYTE/512 byte disk label type: DOS disk identifier:0x12f9141b device boot start end blocks id system/dev/sdb1 2048 10487807 5242880 83 Linux |
| |
| [[email protected]/]# Fdisk/dev/sdb Welcome to use FDISK (Util-linux 2.23.2). changes will stay in memory until you decide to write the changes to disk. Think twice before you use the Write command. command (input m for help): N &NB Sp , &NB Sp , &NB Sp (n to create partition) Partition type: p Primary (1 primary, 0 extended, 3 f REE)   ; , &NB Sp (P-Main section) e extended   &N Bsp (E for extended partition) Select (default p): p area code (2-4, Defaults 2): 2 Start Sector (10487808-41943039, default = 10487808): Default value will be used 10487808Last sector, + sector or +size{k,m,g} (10487808-41943039, default = 41943039): +5g (partition size) partition 2 is set to Linux type, size set to 5 gib command (input m for help): W & nbsp , &N Bsp , &NB Sp (W save settings) the partition table has been altered! calling ioctl () to re-read part Ition table. warning:re-reading the partition table failed with error 16: The device or resource is busy. The kernel still uses the old table. The new table is being used atthe next reboot or after you run Partprobe (8) or KPARTX (8) is synchronizing the disk. |
| |
| [[email protected]/]# partprobe/dev/sdb2 (refresh partition table) [[EMAIL&N Bsp;protected]/]# mke2fs/dev/sdb2mke2fs 1.42.9 (28-dec-2013) file System label =os type:linux block Size =4096 (log=2) chunked size =4096 (log =2) stride=0 blocks, Stripe width=0 blocks327680 inodes, 1310720 blocks65536 blocks (5.00%) reserved for the Super user first number According to block =0maximum filesystem blocks=134217728040 block groups32768 blocks per group, 32768 fragments per group8192 inodes per gr Oupsuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736 allocating Group tables: Completion Writing Inode table: complete writing Superblocks and FileSystem accounting information: Complete |
| Four. Create the directory and mount the partition |
| [Email protected]/]# mkdir/soft[[email protected]/]# Mount/dev/sdb2/soft |
| Five. Set the boot-up self-mount |
[Email protected]/]# Vim/etc/fstab /dev/sdb2/soft XFS Defaults 0 0 |
| Six. View Mounts |
| [[email protected]/]# df-ht file system type capacity used available% mount point/dev/sda3 xfs 48G 3.7g 44g 8%/devtmpfs devtmpfs 906M 0 906m 0%/devtmpfs tmpfs 914m 80k 914m 1%/dev/shmtmpfs tmpfs 914m 8.9m 905m 1%/runtmpfs tmpfs 914M 0 914m 0%/sys/fs/cgroup/dev/sda1 xfs 497m 116m 382m 24%/boot/dev/sdb1 ext2 5.0g 11M 4.7G 1%/dvd/dev/sdb2 ext2 5.0G 10M 4.7G 1%/soft |
Linux Disk partitioning actual case