centos 65 centos7点几哪个版本好用
这篇文章给大家聊聊关于centos 65,以及centos7点几哪个版本好用对应的知识点,希望对各位有所帮助,不要忘了收藏本站哦。
Linux操作系统CentOS65开机自动挂载硬盘
CentOS是社区企业操作系统,是Linux发行版之一,它是来自于Red Hat Enterprise Linux依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些要求高度稳定性的服务器以CentOS替代商业版的Red Hat Enterprise Linux使用。两者的不同,在于CentOS并不包含封闭源代码软件。
企业级应用系统的建设,通常将系统和数据分别存储,并建立raid。新装的CentOS6.5,需要挂载数据盘,并且能够系统启动自动挂载该数据盘。
1、手动挂载磁盘
查看磁盘分区信息,执行fdisk命令
[root@tsp-rls-webservice tsp]# fdisk-l
Disk/dev/sdb: 1476.5 GB, 1476529225728 bytes
255 heads, 63 sectors/track, 179511 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: 0x0008a3a1
Device Boot Start End Blocks Id System
/dev/sdb1 1 179512 1441922048 83 Linux
Disk/dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 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: 0x6a5b51c5
Device Boot Start End Blocks Id System
/dev/sda1* 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 39163 314059776 8e Linux LVM
Disk/dev/mapper/vg_tsprlswebserv-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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
Disk/dev/mapper/vg_tsprlswebserv-lv_swap: 16.8 GB, 16814964736 bytes
255 heads, 63 sectors/track, 2044 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
Disk/dev/mapper/vg_tsprlswebserv-lv_home: 251.1 GB, 251092008960 bytes
255 heads, 63 sectors/track, 30526 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
查看到/dev/sdb1没有挂载,接下来建立挂载点(创建挂载目录),执行mount命令,挂载数据盘。
[root@tsp-rls-webservice tsp]# mkdir/tsp
[root@tsp-rls-webservice tsp]# mount/dev/sdb1/tsp
2、系统启动,自动挂载数据盘
查看磁盘UUID信息
[root@tsp-rls-webservice tsp]# blkid
/dev/mapper/vg_tsprlswebserv-lv_root: UUID="3dedb8a7-69c5-44d7-b590-e70a0b1b3c9a" TYPE="ext4"
/dev/sdb1: UUID="e85dd659-bb20-4d12-a8bc-16130efc04ea" TYPE="ext4"
/dev/sda1: UUID="97f12da1-c972-4508-9028-9b98cde34a34" TYPE="ext4"
/dev/sda2: UUID="cKJ1xc-8mci-0d89-DNaR-5IAG-2JOv-V1G1q9" TYPE="LVM2_member"
/dev/mapper/vg_tsprlswebserv-lv_swap: UUID="aa4589df-1d47-4060-a419-9c4432c3bb9a" TYPE="swap"
/dev/mapper/vg_tsprlswebserv-lv_home: UUID="17a62039-4676-45ce-8eb9-1914e2d4820c" TYPE="ext4"
编辑系统分区表
[root@tsp-rls-webservice tsp]# vi/etc/fstab
添加如下信息:
UUID=e85dd659-bb20-4d12-a8bc-16130efc04ea/tsp ext4 defaults 1 2
编辑后的信息如下:
#
#/etc/fstab
# Created by anaconda on Thu Aug 21 17:17:19 2014
#
# 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
#
/dev/mapper/vg_tsprlswebserv-lv_root/ ext4 defaults 1 1
UUID=97f12da1-c972-4508-9028-9b98cde34a34/boot ext4 defaults 1 2
UUID=e85dd659-bb20-4d12-a8bc-16130efc04ea/tsp ext4 defaults 1 2
/dev/mapper/vg_tsprlswebserv-lv_home/home ext4 defaults 1 2
/dev/mapper/vg_tsprlswebserv-lv_swap 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
保存退出;重启系统,确认自动挂载成功。
以上就是 CentOS6.5开机自动挂载硬盘的执行命令,希望能满足各位的需求。的小编也会继续努力寻找更好方法,请继续关注我们,谢谢。
CentOS65安装的UEFI
我自己在服务器上装了centos 6.5系统,默认用的就是UEFI,没有注意可以只用GRUB,接着问题就出现了,我在服务器内安装了另外一块带grub启动系统的硬盘,
这个硬盘启动系统后,如果去掉此块硬盘,再重新启动,总是识别不出来centos 6.5的UEFI,这个可以通过启动主板的UEFI,然后用UEFI的命令:
mount fs0
fs0:
cd EFI
cd redhat
grub.efi
文件夹名称可能不准,大概是这样就可以手动启动系统了,另外还可以通过插入系统盘,upgrade一下就可以了,不用每次手动,也不会丢失数据,但是总觉得
这样不是很好。所以我就有了将UEFI-GPT回退为MBR的想法。
谷歌总是很牛x,所以我得到的结果是用gdisk,我启动另一个系统,挂载上centos 6.5的硬盘,然后按照google上的步骤:
1
Click"Applications." Point to"Accessories," then click"Terminal." Input the following into Terminal: sudo fdisk-l
2
Press"Enter" to see the disk devices connected to the computer. The device with the asterisk next to it is the boot device. Write down the filename(for example,/dev/sda) assigned to the disk.
3
Input the following into Terminal: sudo apt-get install gdisk. Press"Enter" to install the partitioning tool to Ubuntu.
4
Input"sudo gdisk" into Terminal, then press"Enter" to run gdisk as a superuser. Input the name assigned to the boot device, then press"Enter" again.
5
Press"r," then hit"Enter," to switch to the recovery and transformation options. Press"g," then press"Enter," to select the option to convert GPT to MBR on Linux.
6
Press"w," then press"Enter," to convert GPT to MBR on the primary partitions. Press"y," then"Enter," to finalize and exit.
操作完成后,重启发现系统起不来,手动引导UEFI也不行了。
人类一思考,上帝就发笑,可是俺思考后发现还是能拯救的,
先提前说明,centos 6.5安装的时候,是分了三个区的,sda1-- UEFI所在区,是fat32,sda2--在fdisk-l下显示是NTFS(但实际上是ext4)的存储实际系统和数据的分区,
sda3-- swap分区。
我进入U盘启动的系统后,把sda1分区挂载到mnt目录内,发现在efi->redhat目录内,存在一个文件grub.conf,相比经常把玩系统的人都知道这个是干嘛的。就是有了这个,我才有了希望。
下面就是拯救的具体步骤:
1、mount上sda1,然后拷贝出grub.conf留作后用,切忌!然后umount
2、使用fdisk将sda1修改为83-linux,sda2也修改为83-linux,并且把sda1设置为启动分区。
大致命令流程如下: fdisk/dev/sda t 1 83 t 2 83 a 1
3、将sda1做成ext3,因为他是fat32
命令:mkfs.ext3/dev/sda1
4、mount上sda1和sda2,我这里sda1在/mnt,sda2在/sda2,给sda1安装grub,grub-install--root-directory=/mnt/dev/sda,这样grub就装好了
5、把备份的grub.conf拷贝到/mnt/boot/grub目录下,并且做一个软连接,menu.lst指向grub.conf,命令是:ln-s grub.conf menu.lst
6、将/sda2/boot/目录下在grub.conf内用到的文件,一个是kernel会用到的,一个是initrd会用到的,拷贝到/mnt/boot目录下
7、修改/mnt/boot/grub/grub.conf,把root(hd0, 1)这个改为root(hd0,0)
8、保存,sync,umount,卸载硬盘,重新启动就可以了。
Centos65下安装配置VNCtigervnc服务的详细配置
一、搭建vnc服务器的过程
1.查看tigervnc是否安装。
[root@localhost~]# rpm-qa| grep tigervnc
tigervnc-1.1.0-5.el6_4.1.x86_64
tigervnc-server-1.1.0-5.el6_4.1.x86_64
2.编辑vncservers配置文件。
[root@localhost~]# vim/etc/sysconfig/vncservers
VNCSERVERS="1:root 2:bob"//其中的1表示桌面号,后面指定用户如果设置多个用户可以继续书写,用户必须为系统存在用户,最多为6,端口对应5901-5906。
VNCSERVERARGS[1]="-geometry 1024x768-nolisten tcp"
VNCSERVERARGS[2]="-geometry 1024x768-nolisten tcp"
3.初次启动设置root用户的vnc登录密码,会生成/root/.vnc/passwd密码文件。
[root@localhost~]# vncserver
password:
verify:
4.设置bob用户的vnc登录密码,会生成/home/bob/.vnc/passwd密码文件。
[root@localhost~]# su- bob
[bob@localhost~]$ vncserver
password:
verify:
5.在root用户下,修改/root/.vnc/xstartup文件,启动GNOME桌面还是KDE桌面。
[bob@localhost~]$ exit
logout
[root@localhost~]# vim/root/.vnc/xstartup
#twm&//注释该行
末尾追加如下行:
gnome-session&//如果为KDE桌面,则修改为:startkde&
6.在bob用户下,修改/home/bob/.vnc/xstartup文件,启动GNOME桌面还是KDE桌面。
[bob@localhost~]# vim/home/bob/.vnc/xstartup
#twm&//注释该行
末尾追加如下行:
gnome-session&//如果为KDE桌面,则修改为:startkde&
7.启动关闭服务,搭建完成。
8.在windows上部署VNC VIEWER,傻瓜式安装即可,连接方式为ip:1,或者ip:2,一次类推,对应不同的用户。
二、其他的一些vnc命令
1.关闭root用户的vnc桌面,再连接被拒绝(此时bob用户不受影响,bob用户关闭vnc桌面同root)。
[root@localhost~]# vncserver-kill:1
Killing Xvnc process ID 5962
Xvnc seems to be deadlocked. Kill the process manually and then re-run
/usr/bin/vncserver-kill:1
to clean up the socket files.
重新开启root用户的vnc桌面。
[root@localhost~]# vncserver:1
New'localhost.localdomain:1(root)'desktop is localhost.localdomain:1
Starting applications specified in/root/.vnc/xstartup
Log file is/root/.vnc/localhost.localdomain:1.log
2.修改root用户在初次启动vncserver时设置的vnc登录密码(切换到bob用户,修改方法同root)。
[root@localhost~]# vncpasswd
Password:
Verify:
再次登录需要设置使用新设置的密码。
三、VNC详细介绍
VNC(Virtual Network Computer)是虚拟网络计算机的缩写。VNC是一款优秀的远程控制工具软件,由著名的 AT&T的欧洲研究实验室开发的。VNC是在基于 UNIX和 Linux操作系统的免费的开源软件,远程控制能力强大,高效实用,其性能可以和Windows和 MAC中的任何远程控制软件媲美。在 Linux中,VNC包括以下四个命令:vncserver,vncviewer,vncpasswd,和 vncconnect。大多数情况下用户只需要其中的两个命令:vncserver和 vncviewer。
工作过程:
1)在服务器端启动 VNC Server。
2) VNC客户端通过浏览器或 VNCViewer连接至VNC Server。
3) VNC Server传送一对话窗口至客户端,要求输入连接密码,以及存取的VNC Server显示装置。
4)在客户端输入联机密码后,VNC Server验证客户端是否具有存取权限。
5)若是客户端通过 VNC Server的验证,客户端即要求VNC Server显示桌面环境。
6) VNC Server通过X Protocol要求X Server将画面显示控制权交由VNC Server负责。
7) VNC Server将来由 X Server的桌面环境利用VNC通信协议送至客户端,并且允许客户端控制VNC Server的桌面环境及输入装置。