• pt电子游戏平台_pt电子游戏平台【注册即送28元彩金】

  • 发布时间:2016-01-22 13:34 | 作者:yc | 来源:互联网 | 浏览:1200 次
  • pt电子游戏平台_pt电子游戏平台【注册即送28元彩金】

    -l [device...]: 显现默许或统统的磁盘设备

    示例:

    [root@Lab6-1 ~]# fdisk -l

    Disk /dev/sda: 21.5 GB, 0 bytes

    255 heads, 63 sectors/track, 2610 cylinders

    Units = cylinders of 16065 * 512 = bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Disk identifier: 0x000f3537

    Device BootStartEndBlocksIdSystem

    /dev/sda1*3Linux

    Partition 1 does not end on cylinder boundary.

    /dev/sdaeLinux LVM

    Disk /dev/sdb: 21.5 GB, 0 bytes

    255 heads, 63 sectors/track, 2610 cylinders

    Units = cylinders of 16065 * 512 = bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Disk identifier: 0x

    直接解决解决磁盘并对磁盘分区操作如下,依据需求在Command(m for help)下键入信息

    创立完磁盘分区今后记着 partx -a DEVICE 不然体系不会辨认

    [root@Lab6-1 ~]# fdisk /dev/sda

    [root@Lab6-1 ~]# 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 0x898da2f9.

    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// 新建分区

    Command action

    eextended// 此处是拓展分区

    pprimary partition (1-4)// 此处是主分区

    p// 创立主分区

    Partition number (1-4): 1// 因为咱们是给新的磁盘以是遴选1

    First cylinder (1-2610, default 1):// 这儿默许,直接回车即可

    Using default value 1

    Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +5G// 单位可以是K,M,G

    Command (m for help): P// 显现当前磁盘分区状况

    Disk /dev/sdb: 21.5 GB, 0 bytes

    255 heads, 63 sectors/track, 2610 cylinders

    Units = cylinders of 16065 * 512 = bytes

    Sector size (logical/physical): 512 bytes / 512 bytes

    I/O size (minimum/optimal): 512 bytes / 512 bytes

    Disk identifier: 0x898da2f9

    Device BootStartEndBlocksIdSystem

    /dev/sdb23+83Linux// 查看/dev/sdb1现已创立成功

    Command (m for help): w// 这儿切切不要忘,要记着保留,不然无法见效

    The partition table has been altered!

    Calling ioctl() to re-read partition table.

    Syncing disks.

    1. 输入 m 显现统统指令列示

    一、磁盘根基常识

    机器式硬盘接口类型:

    并口:

    IDE: 133MB/s

    SCSI:640MB/s

    串口:

    SATA: 6Gbps

    SAS: 6Gbps

    USB: 460MB/s

    Linux上的磁盘设备文件命名措施:

    /dev/DEV_FILE:

    IDE:/dev/hd

    SCSI,SATA,SAS,USB: /dev/sd

    不一样设备a-z

    /dev/sda,/dev/sdb....

    同一设备上的不一样分区:1,2....

    二、大略的磁盘空间运用状况查看指令

    df、du指令的运用

    du:概述磁盘运用状况

    常用选项:

    -s:指定文件和目录中统统文件的

    -h:以K,M,G为单位,进步信息的可读性

    示例:

    [root@Lab6-1 ~]# du -h /tmp

    4.0K/tmp/.ICE-unix

    4.0K/tmp/pear/temp

    8.0K/tmp/pear

    68K/tmp

    [root@Lab6-1 ~]# du -sh /etc/

    30M/etc/

    [root@Lab6-1 ~]# du -s /etc/

    30072/etc/

    df:查看文件体系的磁盘空间占用状况

    -i:显现inode节点运用信息

    -h:以K,M,G为单位,进步信息的可读性

    -P:输出格局为POSIX,以规整的格局进行输出

    示例:

    [root@Lab6-1 ~]# df /dev/sda

    Filesystem1K-blocksUsed Available Use% Mounted on

    -% /dev

    [root@Lab6-1 ~]# df -i /dev/sda

    FilesystemInodes IUsedIFree IUse% Mounted on

    - % /dev

    [root@Lab6-1 ~]# df -ih /dev/sda

    FilesystemInodes IUsed IFree IUse% Mounted on

    -120KK1% /dev

    [root@Lab6-1 ~]# df -ihP /dev/sda

    FilesystemInodes IUsed IFree IUse% Mounted on

    -120KK1% /dev

    二、磁盘的分区及格局化解决

    fdisk、mke2fs、tune2fs、fsck、e2fsck、mkswap、swapon、swapoff

    1)fdisk:查询造访硬盘运用状况与磁盘分区功能

    2. 输入 p 显现硬盘切割天气

    3. 输入 a 设定硬盘发动区

    4. 输入 n 设定新的硬盘切割区

    4.1. 输入 e 硬盘为[延伸]切割区(extend)

    4.2. 输入 p 硬盘为[重要]切割区(primary)

    5. 输入 t 篡改硬盘切割区特征

    6. 输入 d 删去硬盘切割区特征

    7. 输入 q 完毕不存入硬盘切割区特征

    8. 输入 w 完毕并写入硬盘切割区特征

    2) mkfs:用来在一个设备上构建Linux支撑的有关文件体系,也可称之为格局化器械

    -t: 指定文件体系类型

    mkfs指令有两种措施:

    1) mkfs.FS_TYPE/dev/DEVICE

    # 常用类型: ex44jjyyt4,xfs,brtfs,vfat

    2) mkfs -t FS_TYPE/dev/DEVICE

    示例:

    [root@Lab6-1 ~]# mkfs.ext3 /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

    inodes, blocks

    65665 blocks (5.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=

    41 block groups

    32768 blocks per group, 32768 fragments per group

    8016 inodes per group

    Superblock backups stored on blocks:

    32768, 98304, , , , ,

    Writing inode tables: done

    Creating journal (32768 blocks): done

    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 30 mounts or

    180 days, whichever comes first.Use tune2fs -c or -i to override.

    [root@Lab6-1 ~]# mkfs -t ext2 /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

    inodes, blocks

    65665 blocks (5.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=

    41 block groups

    32768 blocks per group, 32768 fragments per group

    8016 inodes per group

    Superblock backups stored on blocks:

    32768, 98304, , , , ,

    Writing inode tables: done

    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 22 mounts or

    180 days, whichever comes first.Use tune2fs -c or -i to override.

    3) mke2fs:用于创立磁盘分区上的“ext2/ext3/ext4”文件体系的专有指令

    常用选项:

    -t {ext2|ext3|ext4}::指定etx系列的文件体系的类型

    -j:洞开日志功能,也等于格局化为ext3系列文件体系类型

    -m:设定超级块的的百分比

    -b:指定block块的巨细 1024/2048/4096/

    -L 'LABEL':给磁盘设定卷标

    -i #:数据空间每若干个字节创立一个inode,此巨细不应该小block的巨细

    -n #:为数据空间创立若干个inode

    示例:

    [root@Lab6-1 ~]# mke2fs -t etx4 -b 2048 -L 'sdb_one' -m 3 /dev/sdb1

    mke2fs 1.41.12 (17-May-2010)

    Filesystem label=sdb_one

    OS type: Linux

    Block size=2048 (log=1)

    Fragment size=2048 (log=1)

    Stride=0 blocks, Stripe width=0 blocks

    inodes, blocks

    78798 blocks (3.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=

    161 block groups

    16384 blocks per group, 16384 fragments per group

    2040 inodes per group

    Superblock backups stored on blocks:

    16384, 49152, 81920, , , , , , ,

    Writing inode tables: done

    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 36 mounts or

    180 days, whichever comes first.Use tune2fs -c or -i to override.

    4) blkid:块设备特征信息查看

    常用选项:

    -U UUID:依据指定的UUID来查找对应的设备

    -L LABEL: 很据指定的LABEL来查找对应的设备

    示例:

    [root@Lab6-1 ~]# blkid /dev/sdb1

    /dev/sdb1: UUID="6cae6626-1b85-498f-a424-0c34a3e2e256" TYPE="ext2" LABEL="sdb_one"

    [root@Lab6-1 ~]# blkid -L 'sdb_one'

    /dev/sdb1

    5)tune2fs:从头设定ext系类文件体系可调剂参数的值

    常用选项:

    -l:查看指定文件体系超级块信息

    -L 'LABEL' :修正卷标

    -m # :修正留给解决员的空间百分比

    -j:ext2晋级为ext3,洞开日志功能

    -o: 调剂文件体系的默许挂载选项

    -u UUID:修正UUID号

    示例:

    [root@Lab6-1 ~]# tune2fs -l /dev/sda1

    tune2fs 1.41.12 (17-May-2010)

    Filesystem volume name:

    Last mounted on:/boot

    Filesystem UUID:e7b261b7-858c-44d8-bf72-66ad58a3a3b7

    Filesystem magic number:0xEF53

    Filesystem revision #:1 (dynamic)

    Filesystem features:has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize

    Filesystem flags:signed_directory_hash

    Default mount options:user_xattr acl

    Filesystem state:clean

    Errors behavior:Continue

    Filesystem OS type:Linux

    Inode count:

    Block count:

    Reserved block count:25600

    Free blocks:

    Free inodes:

    First block:1

    Block size:1024

    Fragment size:1024

    Reserved GDT blocks:256

    Blocks per group:8192

    Fragments per group:8192

    Inodes per group:2032

    Inod4685e blocks per group:254

    Flex block group size:16

    Filesystem created:Thu Sep 17 03:28:07 2015

    Last mount time:Tue Sep 22 21:11:28 2015

    Last write time:Tue Sep 22 21:11:28 2015

    Mount count:9

    Maximum mount count:-1

    Last checked:Thu Sep 17 03:28:07 2015

    Check interval:0 ()

    Lifetime writes:50 MB

    Reserved blocks uid:0 (user root)

    Reserved blocks gid:0 (group root)

    First inode:11

    Inode size:128

    Journal inode:8

    Default directory hash:half_md4

    Directory Hash Seed:b41acf8c-bd3f-4803-a824-19661b67741a

    Journal backup:inode blocks

    [root@Lab6-1 ~]# tune2fs -L 'data_db1' /dev/sdb1

    tune2fs 1.41.12 (17-May-2010)

    [root@Lab6-1 ~]# blkid /dev/sdb1

    /dev/sdb1: UUID="6cae6626-1b85-498f-a424-0c34a3e2e256" TYPE="ext2" LABEL="data_db1"

    6)mkswap:创立交流分区

    -L 'LABEL': 设定磁盘卷标

    示例:

    [root@Lab6-1 ~]# mkswap -L 'swap_data' /dev/sdb2

    Setting up swapspace version 1, size = KiB

    LABEL=swap_data, UUID=c49b7121-26fa-4904-a446-7f77aa5104cb

    7)swapon swapoff 洞开、封闭交流分区

    /dev/sdb2的磁盘巨细为1G,把稳查看洞开和封闭交流分区今后free项的巨细改变,

    [root@Lab6-1 ~]# free -g

    totalusedfreesharedbufferscached

    Mem:

    -/+ buffers/cache:00

    Swap:101

    [root@Lab6-1 ~]# swapon /dev/sdb2

    [root@Lab6-1 ~]# free -g

    totalusedfreesharedbufferscached

    Mem:

    -/+ buffers/cache:00

    Swap:202

    [root@Lab6-1 ~]# swapoff /dev/sdb2

    [root@Lab6-1 ~]# free -g

    totalusedfreesharedbufferscached

    Mem:

    -/+ buffers/cache:00

    Swap:101

    8)fsck:文件体系查看

    常用选项:

    -a: 主动修正

    -f: 强行修正// 要是文件体系无错不会进行查看修正的,以是需求强行查看修正

    -r: 交互式问答修正

    示例:

    [root@Lab6-1 ~]# fsck -f /dev/sdb1

    fsck from util-linux-ng 2.17.2

    e2fsck 1.41.12 (17-May-2010)

    Pass 1: Checking inodes, blocks, and sizes

    Pass 2: Checking directory structure

    Pass 3: Checking directory connectivity

    Pass 4: Checking reference counts

    Pass 5: Checking group summary information

    data_db1: 11/ files (0.0% non-contiguous), 47063/ blocks

    [root@Lab6-1 ~]# fsck -a /dev/sdb1

    fsck from util-linux-ng 2.17.2

    data_db1: clean, 11/ files, 47063/ blocks

    [root@Lab6-1 ~]# fsck -r /dev/sdb1

    fsck from util-linux-ng 2.17.2

    e2fsck 1.41.12 (17-May-2010)

    data_db1: clean, 11/ files, 47063/ blocks

    [root@Lab6-1 ~]#

    9) e2fsck:ext系列文件专用的查看修正器械

    常用选项:

    -y: 交互式问答修正时,主动回复为yes

    -f:强行修正;

    示例:

    [root@Lab6-1 ~]# e2fsck -f /dev/sdb1

    e2fsck 1.41.12 (17-May-2010)

    Pass 1: Checking inodes, blocks, and sizes

    Pass 2: Checking directory structure

    Pass 3: Checking directory connectivity

    Pass 4: Checking reference counts

    Pass 5: Checking group summary information

    data_db1: 11/ files (0.0% non-contiguous), 47063/ blocks

  • 相关内容

友情链接: