在linux下,使用fdisk对硬盘分区:先删除原有分区,然后创建新的分区
1) 删除分区
| 代码如下 | 复制代码 |
|
[root@standby root]# fdisk /dev/sdc The number of cylinders for this disk is set to 4425. Command (m for help): m Command (m for help): p Disk /dev/sdc: 36.4 GB, 36401479680 bytes Device Boot Start End Blocks Id System Command (m for help): d Command (m for help): d Command (m for help): d Command (m for help): d Command (m for help): p Disk /dev/sdc: 36.4 GB, 36401479680 bytes Device Boot Start End Blocks Id System Command (m for help): w Calling ioctl() to re-read partition table. |
|
2) 创建分区
| 代码如下 | 复制代码 |
|
[root@standby root]# fdisk /dev/sdc The number of cylinders for this disk is set to 4425. Command (m for help): p Disk /dev/sdc: 36.4 GB, 36401479680 bytes Device Boot Start End Blocks Id System Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): d Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): n Command (m for help): p Disk /dev/sdc: 36.4 GB, 36401479680 bytes Device Boot Start End Blocks Id System Command (m for help): w Calling ioctl() to re-read partition table.
|
|
分区建好后有两种方法:使用文件系统,使用裸设备
1) 使用文件系统
创建文件系统
| 代码如下 | 复制代码 |
|
[root@standby root]# mkdir /test Writing inode tables: done This filesystem will be automatically checked every 38 mounts or |
|
挂接文件系统
| 代码如下 | 复制代码 |
| [root@standby root]# mount /dev/sdc3 /test | |
改权限
| 代码如下 | 复制代码 |
|
[root@standby root]# ls -ltr /test [root@standby root]# chown -R oracle.dba /test [root@standby root]# ls -ltr /test |
|
创建表空间
| 代码如下 | 复制代码 |
|
SQL> create tablespace chen Tablespace created. |
|
向表空间增加数据文件
| 代码如下 | 复制代码 |
|
SQL> alter tablespace chen Tablespace altered. |
|
可以看到表空间chen的大小是20m了
| 代码如下 | 复制代码 |
|
SQL> select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size TABLESPACE_NAME TS_SIZE |
|
2) 使用裸设备
可以看到已有的绑定
| 代码如下 | 复制代码 |
| [root@standby root]# raw -qa /dev/raw/raw1: bound to major 8, minor 17 /dev/raw/raw2: bound to major 8, minor 18 /dev/raw/raw3: bound to major 8, minor 19 /dev/raw/raw4: bound to major 8, minor 20 /dev/raw/raw5: bound to major 8, minor 34 |
|
绑定裸设备
| 代码如下 | 复制代码 |
|
[root@standby test]# raw /dev/raw/raw6 /dev/sdc1 ditional information: 1 |
|
改权限
| 代码如下 | 复制代码 |
| [root@standby root]# chown -R oracle.dba /dev/raw [root@standby root]# chmod 755 /dev/raw |
|
创建表空间
| 代码如下 | 复制代码 |
|
SQL> create tablespace jin Tablespace created |
|
指令:fdisk
用途:观察硬盘之实体使用情形与分割硬盘用。
使用方法:
一、在 console 上输入 fdisk -l /dev/sda ,观察硬盘之实体使用情形。
二、在 console 上输入 fdisk /dev/sda,可进入分割硬盘模式。
1. 输入 m 显示所有命令列示。
2. 输入 p 显示硬盘分割情形。
3. 输入 a 设定硬盘启动区。
4. 输入 n 设定新的硬盘分割区。
4.1. 输入 e 硬盘为[延伸]分割区(extend)。
4.2. 输入 p 硬盘为[主要]分割区(primary)。
5. 输入 t 改变硬盘分割区属性。
6. 输入 d 删除硬盘分割区属性。
7. 输入 q 结束不存入硬盘分割区属性。
8. 输入 w 结束并写入硬盘分割区属性
模拟极限越野
模拟极限越野开着大巴在各种奇葩路况里送乘客。山路弯道多得让人
模拟火车
模拟火车让你当回真正的火车司机,得先学会看信号灯、操作控制杆
可口的披萨美味的披萨
可口的披萨美味的披萨带您体验经营一家披萨店的乐趣。游戏画风温
定制虚拟偶像最新版
定制虚拟偶像最新版是一款超级经典有趣的日本模拟装扮类型的手游
病娇模拟器手机版正版(yandere simulator)
病娇模拟器最新版手游是一款萌妹二次元模拟游戏,玩家在游戏中可