Tag Archives: Linux

Linux下添加新硬盘并挂载使用

1、 查看新磁盘信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@Crayfish ~]# fdisk -l
 
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00060953
 
    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        2611    20970496   83  Linux
 
Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00000000

2、硬盘分区

2.1、进入fdisk模式

1
2
3
4
5
6
7
8
9
10
11
[root@Crayfish ~]# fdisk /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xc233737d.
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').

2.2、输入n进行分区
[……]

继续阅读

CentOS查看当前CPU及内存使用情况(任务管理器)

Linux下没有类似Windows的可视化窗口来查看当前设备硬件资源使用情况,但通过命令行一样能够了解到我们需要的信息,使用top命令

1
2
[root@Crayfish ~]# top
top - 17:17:36 up 0 min,  1 user,  load average: 0.20, 0.0[......]<p class="read-more"><a href="https://www.yusian.com/blog/centos/2015/05/14/171950655.html">继续阅读</a></p>

CentOS设置随机启动项的三种方式

1、把启动程序的命令添加到/etc/rc.d/rc.local文件中,如随机启动svn服务

1
2
3
[root@Crayfish ~]# cd /etc/rc.d/
[root@Crayfish rc.d]# ls
init.d  rc  rc0.d  rc1.d  rc2.d  rc3.d  rc4.d[......]<p class="read-more"><a href="https://www.yusian.com/blog/centos/2015/04/23/093157657.html">继续阅读</a></p>

如何安装phpmyadmin

1、下载安装包并安装服务

yum install phpmyadmin

2、开启远程访问(默认情况下只有127.0.0.1的地址能访问)

2.1打开配置文件 vi /etc/httpd/conf.d

1
2
3
4
 
     # Apache 2.4
 
       Require ip[......]<p class="read-more"><a href="https://www.yusian.com/blog/centos/2014/09/16/142716659.html">继续阅读</a></p>

CentOS 命令行登录欢迎词

1、修改/ect/motd文件即可如:

1
2
3
yusiandeMacBook-Pro:~ yusian$ ssh [email protected]
[email protected]'s password: 
Last login: Mon Jul 28 13:57:59 2014 from 112.216[......]<p class="read-more"><a href="https://www.yusian.com/blog/centos/2014/07/28/140535662.html">继续阅读</a></p>