问题2:新系统盘和旧系统盘同时连上,想进入光盘引导程序的安装界面时提示“There is a problem with your existing storage configuration: multiple LVM volume groups with the same name”
问题3:两个系统启动顺序设置
问题4:安装光盘中仅有最简化安装CentOS 7一个选项,最简化安装的系统需要配置一下才能联网
过程
在实际操作前先做一下理论上的准备
总结:机器上装固态、装系统基本上没用什么命令,比在阿里云上加硬盘简单些。
可能用到的命令
1. fdisk -l查看分区(partition)表
fdisk -help
Usage:
fdisk [options] change partition table(修改分区表)
fdisk [options] -l list partition table(s)
fdisk -s give partition size(s) in blocks
Options:
-b sector(扇区) size (512, 1024, 2048 or 4096)
-c[=] compatible mode(兼容模式): 'dos' or 'nondos' (default)
-h print this help text(等价于-help)
-u[=] display units(显示单元): 'cylinders(柱面数)' or 'sectors(扇区数)' (default)
-v print program version
-C specify the number of cylinders(指定柱面数)
-H specify the number of heads(指定磁头数)
-S specify the number of sectors per track(指定每个磁道的扇区数)
2. umount -l绝大多数情况下一定会有效的卸载分区方式
Usage:
umount [-hV]
umount -a [options]
umount [options] |
Options:
-a, --all unmount all filesystems(卸载所有文件系统)
-A, --all-targets unmount all mountpoins for the given device
in the current namespace(卸载当前命名空间下指定设备的所有挂载点)
-c, --no-canonicalize don't canonicalize paths(不规范化路径)
-d, --detach-loop if mounted loop device, also free this loop device(如果挂载了循环设备,也释放这个循环设备)
--fake dry run; skip the umount(2) syscall(演示:跳过umount(2))
-f, --force force unmount (in case of an unreachable NFS system)(在无法访问NFS时进行强制卸载)
-i, --internal-only don't call the umount. helpers
-n, --no-mtab don't write to /etc/mtab(不要写入这个路径)
-l, --lazy detach the filesystem now, and cleanup all later(现在分离这个文件系统同时清理所有进程)
-O, --test-opts limit the set of filesystems (限制文件系统集)(use with -a)
-R, --recursive recursively unmount a target with all its children(递归卸载一个目标及其所有子对象)
-r, --read-only In case unmounting fails, try to remount read-only(如果卸载失败,请尝试以只读的方式重新挂载)
-t, --types limit the set of filesystem types
-v, --verbose say what is being done
-h, --help display this help and exit
-V, --version output version information and exit
For more details see umount(8).
3. fdisk <分区名称>修改分区表
例如:fdisk /dev/vda
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): m
Command action
a toggle a bootable flag(切换一个启动标志)
b edit bsd disklabel(编辑磁盘标签)
c toggle the dos compatibility flag(切换dos兼容性标志)
d delete a partition(删除一个分区)
g create a new empty GPT partition table(创建一个新的空GTP分区表)
G create an IRIX (SGI) partition table(创建一个IRIX(SGI)分区表)
l list known partition types(列出已知的分区类型)
m print this menu(打印这个主菜单)
n add a new partition(添加一个新分区)
o create a new empty DOS partition table(创建一个新的空DOS分区表)
p print the partition table(打印分区表)
q quit without saving changes(不保存更改 退出)
s create a new empty Sun disklabel(创建一个新的空Sun磁盘标签)
t change a partition's system id(更改分区的系统ID)
u change display/entry units(改变显示/输入单元)
v verify the partition table(验证分区表)
w write table to disk and exit(将分区表写入磁盘 退出)
x extra functionality (experts only)(额外功能(仅限专家))
FSCK(8) System Administration FSCK(8)
NAME
fsck - check and repair a Linux filesystem
SYNOPSIS
fsck [-lrsAVRTMNP] [-C [fd]] [-t fstype] [filesystem...] [--] [fs-specific-
options]
DESCRIPTION
fsck is used to check and optionally repair one or more Linux filesystems.
filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2), a mount point (e.g.
/, /usr, /home), or an ext2 label or UUID specifier (e.g.
UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the fsck
program will try to handle filesystems on different physical disk drives in par‐
allel to reduce the total amount of time needed to check all of them.
If no filesystems are specified on the command line, and the -A option is not
specified, fsck will default to checking filesystems in /etc/fstab serially.
This is equivalent to the -As options.
The exit code returned by fsck is the sum of the following conditions:
0 No errors
1 Filesystem errors corrected
2 System should be rebooted
4 Filesystem errors left uncorrected
FDISK(8) System Administration FDISK(8)
NAME
fdisk - manipulate disk partition table(操作磁盘分区表)
SYNOPSIS
fdisk [-uc] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device
fdisk -l [-u] [device...]
fdisk -s partition...
fdisk -v
fdisk -h
DESCRIPTION
fdisk (in the first form of invocation) is a menu-driven program for creation and
manipulation of partition tables.
(fdisk(第一种调用形式)是一个菜单驱动程序,用于创建和操作分区表。)
It understands GPT (experimental for now), MBR, Sun, SGI and BSD partition tables.
(它理解GPT(目前还处于试验阶段)、MBR、Sun、SGI和BSD分区表。)
fdisk does not use DOS-compatible mode and cylinders as display units by default.
(默认情况下,磁盘不使用与dos兼容的模式和柱面作为显示单元。)
The old deprecated DOS behavior can be enabled with the '-c=dos -u=cylinders'
command-line options.
(可以通过命令行选项'-c= DOS -u=cylinder '来启用旧的已弃用的DOS模式。)
Hard disks can be divided into one or more logical disks called partitions.
(硬盘可以被划分为一个或多个逻辑磁盘,称为分区。)
This division is recorded in the partition table, found in sector 0 of the disk.
这个分区记录在磁盘扇区0中的分区表中。
(In the BSD world one talks about `disk slices' and a `disklabel'.)
(在BSD领域中有人称其为“磁盘片”和“磁盘标签”。)
Linux needs at least one partition, namely for its root file system.
(Linux至少需要一个分区,即用于它的根文件系统。)
It can use swap files and/or swap partitions, but the latter are more efficient.
(它可以使用交换文件 和/或 交换分区,但是后者更有效。)
So, usually one will want a second Linux partition dedicated as swap partition. (因此,通常需要一个专用的Linux分区作为交换分区。)
On Intel-compatible hardware, the BIOS that boots the system can often only access
the first 1024 cylinders of the disk.(在intel兼容的硬件上,引导系统的BIOS通常只能访问磁盘的前1024个柱面。)
For this reason people with large disks often create a third partition, just a few MB large, typically mounted on /boot, to store the kernel image and a few auxiliary files needed at boot time, so as to make sure that this stuff is accessible to the BIOS.
(因此,拥有大磁盘的人通常会创建第三个分区,只有几MB大,通常挂载在/boot上,以存储内核映像和引导时需要的一些辅助文件,以便确保BIOS可以访问这些文件。)
There may be reasons of security, ease of administration and backup, or testing, to use more than the minimum number of partitions.
(可能出于安全性、易于管理和备份或测试的原因,使用的分区数量超过了最小分区数。)
DEVICES
The device is usually /dev/sda, /dev/sdb or so. A device name refers to the
entire disk. Old systems without libata (a library used inside the Linux kernel
to support ATA host controllers and devices) make a difference between IDE and
SCSI disks. In such cases the device name will be /dev/hd* (IDE) or /dev/sd*
(SCSI).
The partition is a device name followed by a partition number. For example,
/dev/sda1 is the first partition on the first hard disk in the system. See also
Linux kernel documentation (the Documentation/devices.txt file).
lsblk:
LSBLK(8) System Administration LSBLK(8)
NAME
lsblk - list block devices(列出设备文件)
SYNOPSIS
lsblk [options] [device...]
DESCRIPTION
lsblk lists information about all available or the specified block devices. (lsblk列出关于所有可用的或指定的块设备的信息。) The
lsblk command reads the sysfs filesystem to gather information.(lsblk命令读取sysfs文件系统以收集信息。)
The command prints all block devices (except RAM disks) in a tree-like format by
default.(该命令默认情况下以类似树的格式打印所有块设备(RAM磁盘除外)。) Use lsblk --help to get a list of all available columns.(使用lsblk——帮助获取所有可用列的列表。)
The default output, as well as the default output from options like --fs and
--topology, is subject to change. (默认输出以及--fs和--topology等选项的默认输出都可以更改。) So whenever possible, you should avoid using
default outputs in your scripts. (因此,只要可能,您应该避免在脚本中使用默认输出。) Always explicitly define expected columns by
using --output columns-list in environments where a stable output is required.(在需要稳定输出的环境中,始终使用--output columns-list显式定义预期的列。)
OPTIONS
-a, --all
Also list empty devices. (By default they are skipped.)
-b, --bytes
Print the SIZE column in bytes rather than in a human-readable format.
MKFS(8) System Administration MKFS(8)
NAME
mkfs - build a Linux filesystem(构建Linux文件系统)
SYNOPSIS
mkfs [options] [-t type] [fs-options] device [size]
DESCRIPTION
mkfs is used to build a Linux filesystem on a device, usually a hard disk parti‐
tion.
(mkfs用于在设备(通常是硬盘部件)上构建Linux文件系统。)
The device argument is either the device name (e.g. /dev/hda1,/dev/sdb2),
or a regular file that shall contain the filesystem.
(设备参数要么是设备名称(例如/dev/hda1、/dev/sdb2),要么是一个包含文件系统的常规文件。)
The size argument is the number of blocks to be used for the filesystem.
(大小参数是用于文件系统的块数。)
The exit code returned by mkfs is 0 on success and 1 on failure.
(mkfs返回的退出代码成功时为0,失败时为1。)
In actuality, mkfs is simply a front-end for the various filesystem builders
(mkfs.fstype) available under Linux.
(实际上,mkfs只是Linux下可用的各种文件系统构建器(mkfs.fstype)的前端。)
The filesystem-specific builder is searched for in a number of directories,
like perhaps /sbin, /sbin/fs, /sbin/fs.d, /etc/fs, /etc (the precise list is defined
at compile time but at least contains /sbin and /sbin/fs), and finally in the
directories listed in the PATH environment variable.
(特定于文件系统的构建器在许多目录中搜索,比如/sbin、/sbin/fs、/sbin/fs.d, /etc/fs, /etc(精确的列表是在编译时定义的,但至少包含/sbin和/sbin/fs),最后在PATH环境变量中列出的目录中。)
Please see the filesystem-specific builder manual pages for fur‐
ther details.(详细信息请参见特定于文件系统的构建器手册页面。)
OPTIONS
-t, --type type
Specify the type of filesystem to be built. If not specified, the default
filesystem type (currently ext2) is used.
(指定要构建的文件系统的类型。如果未指定,则使用默认的文件系
统类型(当前为ext2)。)
fs-options
Filesystem-specific options to be passed to the real filesystem builder.
Although not guaranteed, the following options are supported by most
filesystem builders.
(特定于文件系统的选项被传递给真正的文件系统构建器。虽然没有得到
保证,但大多数文件系统构建器都支持以下选项。)
-V, --verbose
Produce verbose output, including all filesystem-specific commands that
are executed. Specifying this option more than once inhibits execution of
any filesystem-specific commands. This is really only useful for testing.
-V, --version
Display version information and exit. (Option -V will display version
information only when it is the only parameter, otherwise it will work as
--verbose.)
-h, --help
Display help and exit.
MKE2FS(8) System Manager's Manual MKE2FS(8)
NAME
mke2fs - create an ext2/ext3/ext4 filesystem(创建ext2/ext3/ext4文件系统)
SYNOPSIS
mke2fs [ -c | -l filename ] [ -b block-size ] [ -D ] [ -f fragment-size ] [ -g
blocks-per-group ] [ -G number-of-groups ] [ -i bytes-per-inode ] [ -I inode-size
] [ -j ] [ -J journal-options ] [ -N number-of-inodes ] [ -n ] [ -m reserved-
blocks-percentage ] [ -o creator-os ] [ -O feature[,...] ] [ -q ] [ -r fs-revi‐
sion-level ] [ -E extended-options ] [ -v ] [ -F ] [ -L volume-label ] [ -M last-
mounted-directory ] [ -S ] [ -t fs-type ] [ -T usage-type ] [ -U UUID ] [ -V ]
device [ blocks-count ]
mke2fs -O journal_dev [ -b block-size ] [ -L volume-label ] [ -n ] [ -q ] [ -v ]
external-journal [ blocks-count ]
DESCRIPTION
mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk
partition.
(mke2fs用于创建ext2、ext3或ext4文件系统,通常在磁盘分区中。)
device is the special file corresponding to the device (e.g
/dev/hdXX).
(设备是设备对应的特殊文件)
blocks-count is the number of blocks on the device. (块计数是设备上的块数)
If omitted,mke2fs automagically figures the file system size. If called as
mkfs.ext3 a journal is created as if the -j option was specified.
(如果省略,mke2fs自动绘制文件系统大小。如果作为mkfs调用。
ext3日志被创建,就像指定了-j选项一样)
The defaults of the parameters for the newly created filesystem, if not overrid‐
den by the options listed below, are controlled by the /etc/mke2fs.conf configu‐
ration file.
(新创建的文件系统的默认参数,如果没有下面列出的选项的overrid‐den,
则由/etc/mke2fs.conf配置‐ration文件控制。)
See the mke2fs.conf(5) manual page for more details.
7.mount A B 将分区A挂载到位置B
-V, --version output version information and exit
Source:
-L, --label
8.设置开机自动挂载:vi /etc/fstab
思路
备份数据
服务器关机
拔下旧硬盘
插上新硬盘
进入BIOS,设置启动引导方式
安装CentOS7系统
系统配置
关机
插上旧硬盘
将旧硬盘作为数据盘进行挂载
设置开机自动挂载
完成
总结
先总结这次过程中一些操作导致的麻烦问题
问题1: 初始root密码设置的有些复杂,导致后面系统装成功后,总是提示密码错误
没办法,只能再次重装
解决办法:测试用的root密码设简单点就好…( _ _)ノ|
问题2:新系统盘和旧系统盘同时连上,想进入光盘引导程序的安装界面时提示“There is a problem with your existing storage configuration: multiple LVM volume groups with the same name”
返回做IO数目最多的50条语句以及它们的执行计划。
select top 50
(total_logical_reads/execution_count) as avg_logical_reads,
(total_logical_writes/execution_count) as avg_logical_writes,
(tot
The CUDA 5 Release Candidate is now available at http://developer.nvidia.com/<wbr></wbr>cuda/cuda-pre-production. Now applicable to a broader set of algorithms, CUDA 5 has advanced fe
Essential Studio for WinRT界面控件包含了商业平板应用程序开发中所需的所有控件,如市场上运行速度最快的grid 和chart、地图、RDL报表查看器、丰富的文本查看器及图表等等。同时,该控件还包含了一组独特的库,用于从WinRT应用程序中生成Excel、Word以及PDF格式的文件。此文将对其另外一个强大的控件——网格控件进行专门的测评详述。
网格控件功能
1、
Project Euler是个数学问题求解网站,网站设计的很有意思,有很多problem,在未提交正确答案前不能查看problem的overview,也不能查看关于problem的discussion thread,只能看到现在problem已经被多少人解决了,人数越多往往代表问题越容易。
看看problem 1吧:
Add all the natural num
Adding id and class names to CMenu
We use the id and htmlOptions to accomplish this. Watch.
//in your view
$this->widget('zii.widgets.CMenu', array(
'id'=>'myMenu',
'items'=>$this-&g
Given a collection of integers that might contain duplicates, nums, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solution set must not conta