linux服务 运维案例,linux运维实战练习案例-2015年12月20日-12月31日

1、创建一个10G的文件系统,类型为ext4,要求开机可自动挂载至单独数据/data目录;

[[email protected] /]# cat /proc/partitions

major minor  #blocks  name

8        0   52428800 sda

8        1     204800 sda1

8        2    4096000 sda2

8        3   48126976 sda3

8       16   10485760 sdb

[[email protected] /]# fdisk /devsdb

Unable to open /devsdb

[[email protected] /]# 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 0x68f6d495.

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): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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: 0x68f6d495

Device Boot      Start         End      Blocks   Id  System

Command (m for help): n

Command action

e   extended

p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):

Using default value 1305

Command (m for help): p

Disk /dev/sdb: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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: 0x68f6d495

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        1305    10482381   83  Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

[[email protected] /]# mkfs.ext4 /dev/sdb

mke2fs 1.41.12 (17-May-2010)

/dev/sdb is entire device, not just one partition!

Proceed anyway? (y,n) y

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

655360 inodes, 2621440 blocks

131072 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=2684354560

80 block groups

32768 blocks per group, 32768 fragments per group

8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done

Creating journal (32768 blocks):

done

Writing superblocks and filesystem accounting information:

done

This filesystem will be automatically checked every 38 mounts or

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

[[email protected] /]# cat /proc/partitions

major minor  #blocks  name

8        0   52428800 sda

8        1     204800 sda1

8        2    4096000 sda2

8        3   48126976 sda3

8       16   10485760 sdb

8       17   10482381 sdb1

[[email protected] /]# mkdir /mydata1

[[email protected] /]# mount /dev/sdb1 /mydata1/

mount: you must specify the filesystem type

[[email protected] /]# mount /dev/sdb /mydata1/

[[email protected] /]# cd /mydata1/

lost+found

lost+found

[[email protected] mydata1]# cd lost+found/

[[email protected] lost+found]# cd ..

lost+found

Filesystem     1K-blocks    Used Available Use% Mounted on

/dev/sda3       47371632 1628584  43336700   4% /

tmpfs             510148       0    510148   0% /dev/shm

/dev/sda1         198337   26862    161235  15% /boot

/dev/sdb        10321208  154100   9642820   2% /mydata1

[[email protected] mydata1]# vi /etc/fstab

[[email protected] mydata1]# cat /etc/fstab

#

# /etc/fstab

# Created by anaconda on Wed Dec  9 01:17:20 2015

#

# Accessible filesystems, by reference, are maintained under ‘/dev/disk‘

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

UUID=1a36e597-b5e2-4b66-9250-2e4af5eecf3f /                       ext4    defaults        1 1

UUID=133f8aff-57bf-41d5-8570-1d40cae3d13b /boot                   ext4    defaults        1 2

UUID=dadabadb-1467-4921-88d1-47ba1eddbf71 swap                    swap    defaults        0 0

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/sdb/mydata1ext4defaults0 0

2、显示`netstat -tan`命令结果中以‘LISTEN’后跟0个、1个或者多个空白字符结尾的行;

[[email protected] mydata1]# netstat -tan |grep ‘LISTEN[ ]*$‘

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN

tcp        0      0 0.0.0.0:1433                0.0.0.0:*                   LISTEN

tcp        0      0 ::1:25                      :::*                        LISTEN

tcp        0      0 :::1433                     :::*                        LISTEN

完蛋了,换了好几浏览器都报405错误,我都无语了。我改用txt文档上次吧

原文:http://725689.blog.51cto.com/715689/1729273

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值