标签:rri which tor display async calling tar using form
磁盘分区管理
fdisk 进行分区
// 查看硬盘信息 lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 150G 0 disk ├─sda1 8:1 0 200M 0 part /boot ├─sda2 8:2 0 2G 0 part [SWAP] └─sda3 8:3 0 147.8G 0 part ├─vg_centos6-LogVol02 (dm-0) 253:0 0 67.8G 0 lvm / ├─vg_centos6-LogVol00 (dm-1) 253:1 0 40G 0 lvm /usr └─vg_centos6-LogVol01 (dm-2) 253:2 0 40G 0 lvm /data sdb 8:16 0 100G 0 disk // 新添加的硬盘; // 对 sdb 硬盘进行分区 fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0xb9f722f6. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won‘t be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to switch off the mode (command ‘c‘) and change display units to sectors (command ‘u‘). Command (m for help): n // n 为新增分区; e extended // e 表示 扩展分区; p primary partition (1-4) // p 表示 主分区; p Partition number (1-4): 1 // 第一个分区 First cylinder (1-13054, default 1): // 分区大小,默认从1开始 Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-13054, default 13054): +50G // 自己设定大小, 可使用 K M G Command (m for help): p // 打印分区信息; Disk /dev/sdb: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb9f722f6 Device Boot Start End Blocks Id System /dev/sdb1 1 6528 52436128+ 83 Linux Command (m for help): n // 新增分区 Command action e extended p primary partition (1-4) e // 选择 扩展分区 Partition number (1-4): 4 // 编号可自行选择; First cylinder (6529-13054, default 6529): // 磁盘开始 Using default value 6529 Last cylinder, +cylinders or +size{K,M,G} (6529-13054, default 13054): // 分区大小, 默认全部; Using default value 13054 Command (m for help): p // 打印查看; Disk /dev/sdb: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb9f722f6 Device Boot Start End Blocks Id System /dev/sdb1 1 6528 52436128+ 83 Linux /dev/sdb4 6529 13054 52420095 5 Extended Command (m for help): n Command action l logical (5 or over) // 逻辑分区 p primary partition (1-4) l First cylinder (6529-13054, default 6529): Using default value 6529 Last cylinder, +cylinders or +size{K,M,G} (6529-13054, default 13054): +20G Command (m for help): p Disk /dev/sdb: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xb9f722f6 Device Boot Start End Blocks Id System /dev/sdb1 1 6528 52436128+ 83 Linux /dev/sdb4 6529 13054 52420095 5 Extended /dev/sdb5 6529 9140 20980858+ 83 Linux Command (m for help): W // W 为保存分区 The partition table has been altered! // 分区表已被更改 Calling ioctl() to re-read partition table. Syncing disks. // 同步磁盘
格式化分区
// 格式化分区 ( 常见的分区格式: ext4 , xfs , ext3 等), 7以下不存在"xfs" mkfs.ext4 /dev/sdb1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 3278576 inodes, 13109032 blocks 655451 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 401 block groups 32768 blocks per group, 32768 fragments per group 8176 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. // 查看分区格式; 同时可查看分区的 UUID; blkid /dev/sdb1 // 或者直接 blkid 查看所有
开机挂载分区
// 编辑开机挂载配置文件 /etc/fstab vim /etc/fstab ... ... /dev/sdb1 /data ext4 defaults 1 2 // 第一部分: 指定要挂载的设备名称或块信息, 也可以是远程文件系统 // 第二部分: 挂载点, swap 分区, 为 none // 第三部分: 指定文件类型 // 第四部分: 默认 defaults, 表示包含选项: rw, suid, dev, exec, auto, nouser 和 async // >> 自动与手动挂载 // auto: 自动挂载 // noauto: 手动挂载 // >> 可执行 // exec: 是一个默认设置项,使分区中可执行的二进制文件能够执行; // noexec: 二进制文件不允许执行, root分区 万万不能 使用 // >> I/O 同步 // sync: 所有的I/O将以同步方式进行 // nosync: 所有的 I/O 将以非同步的方式进行 // 用户挂载权限 // user: 允许任何用户挂载设备, // nouser: 只允许 root 用户挂载, 默认设置 // 第五部分: <dump> 1 表示要将整个<file system>里的内容备份, 0 表示不备份, 现在很少用到 dump 工具, 所以一般选 "0" // 第六部分: <pass> 指定如何使用fsck检查硬盘 // 0 不检查; // 1 挂载点"/", 必须是 1; 其他都不能使用 1; // 2,3,4... 检查完根分区后, 根据数字大小从小到大依次检查;
标签:rri which tor display async calling tar using form
原文地址:https://www.cnblogs.com/haorong/p/10594214.html