惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - 沧海笑

会计帐目用语 见识阿里巴巴的妖精团队 新的一年需要改进的地方还有很多 ERP系統借贷关系表 作业成本法项目实施感想系列之十二:标准成本还是实际成本 关于管理会计 标准和平均成本计算比较 VMware 下 RHEL4网络配置 Vmware tools安装 Vmware 网络连接方式汇总(见回复1) 看书笔记:从今天开始看《LINUX与UNIX SHELL编程指南》, 计划每天一章,希望能够坚持下来。 linux常用命令 ebsse clone manual modify dba password oracle EBS 报表不能输出常见解决方案 VSFTPD的设置参考文档(转载) oracel ebs 管理学习篇二--------如果创建自定义菜单 oracel ebs 管理学习篇一 关于oracle EBS 项目成本分摊
linux下使用fdisk分区 (转载小惠惠)
沧海笑 · 2006-05-30 · via 博客园 - 沧海笑
linux下使用fdisk分区

在linux下,使用fdisk对硬盘分区:先删除原有分区,然后创建新的分区


1) 删除分区

[root@standby root]# fdisk /dev/sdc

The number of cylinders for this disk is set to 4425.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/sdc: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sdc1             1       250   2008093+  83  Linux
/dev/sdc2           251       500   2008125   83  Linux
/dev/sdc3           501       750   2008125   83  Linux
/dev/sdc4           751      4425  29519437+   5  Extended
/dev/sdc5           751      1000   2008093+  83  Linux
/dev/sdc6          1001      4425  27511281   83  Linux

Command (m for help): d
Partition number (1-6): 1

Command (m for help): d
Partition number (1-6): 2

Command (m for help): d
Partition number (1-6): 3

Command (m for help): d
Partition number (1-6): 4

Command (m for help): p

Disk /dev/sdc: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


2) 创建分区

[root@standby root]# fdisk /dev/sdc

The number of cylinders for this disk is set to 4425.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdc: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   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-4425, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4425, default 4425): +500

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (502-4425, default 502):
Using default value 502
Last cylinder or +size or +sizeM or +sizeK (502-4425, default 4425): +2048M

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (752-4425, default 752):
Using default value 752
Last cylinder or +size or +sizeM or +sizeK (752-4425, default 4425): +2048000K

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Selected partition 4
First cylinder (1002-4425, default 1002):
Using default value 1002
Last cylinder or +size or +sizeM or +sizeK (1002-4425, default 4425): +2048M

Command (m for help): n
You must delete some partition and add an extended partition first

Command (m for help): d
Partition number (1-4): 4

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Selected partition 4
First cylinder (1002-4425, default 1002):
Using default value 1002
Last cylinder or +size or +sizeM or +sizeK (1002-4425, default 4425):
Using default value 4425

Command (m for help): n
First cylinder (1002-4425, default 1002):
Using default value 1002
Last cylinder or +size or +sizeM or +sizeK (1002-4425, default 4425): +2048M

Command (m for help): n
First cylinder (1252-4425, default 1252):
Using default value 1252
Last cylinder or +size or +sizeM or +sizeK (1252-4425, default 4425): +2048M

Command (m for help): n
First cylinder (1502-4425, default 1502):
Using default value 1502
Last cylinder or +size or +sizeM or +sizeK (1502-4425, default 4425):
Using default value 4425

Command (m for help): n
No free sectors available

Command (m for help): p

Disk /dev/sdc: 36.4 GB, 36401479680 bytes
255 heads, 63 sectors/track, 4425 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sdc1             1       501   4024251   83  Linux
/dev/sdc2           502       751   2008125   83  Linux
/dev/sdc3           752      1001   2008125   83  Linux
/dev/sdc4          1002      4425  27503280    5  Extended
/dev/sdc5          1002      1251   2008093+  83  Linux
/dev/sdc6          1252      1501   2008093+  83  Linux
/dev/sdc7          1502      4425  23486998+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

分区建好后有两种方法:使用文件系统,使用裸设备

1) 使用文件系统

创建文件系统
[root@standby root]# mkdir /test
[root@standby root]# mkfs  /dev/sdc3
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
251392 inodes, 502031 blocks
25101 blocks (5.00%) reserved for the super user
First data block=0
16 block groups
32768 blocks per group, 32768 fragments per group
15712 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912

Writing inode tables: 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.

挂接文件系统
[root@standby root]# mount /dev/sdc3 /test

改权限
[root@standby root]# ls -ltr  /test
total 16
drwx------    2 root     root        16384 Jun 20 21:51 lost+found

[root@standby root]# chown  -R  oracle.dba  /test
[root@standby root]# chmod 755 /test

[root@standby root]# ls -ltr  /test
total 16
drwx------    2 oracle   dba         16384 Jun 20 21:51 lost+found

创建表空间
SQL> create tablespace chen
  2  datafile '/test/chen.dbf' size 10M;

Tablespace created.

向表空间增加数据文件
SQL> alter tablespace chen
  2  add datafile '/test/chen2.dbf' size 10M;

Tablespace altered.

可以看到表空间chen的大小是20m了
SQL>     select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
  2      from dba_tablespaces t, dba_data_files d
  3      where t.tablespace_name = d.tablespace_name
  4      group by t.tablespace_name;

TABLESPACE_NAME                                                 TS_SIZE
------------------------------------------------------------ ----------
CHEN                                                                 20
EYGLE                                                                10
SYSTEM                                                              250
UNDOTBS1                                                            200
USERS                                                                25


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
/dev/raw/raw6:  bound to major 8, minor 33

ditional information: 1

改权限
[root@standby root]# chown -R oracle.dba /dev/raw
[root@standby root]# chmod 755 /dev/raw

创建表空间
SQL> create tablespace jin
  2  datafile '/dev/raw/raw6' size 10M;

Tablespace created.