linux swap hex code,Linux_利用fdisk建立swap分区

原地址: http://blog.sina.com.cn/s/blog_5ef712770100cpr9.html

这种情况可以针对没有建立swap或者swap空间比较小。

1、对硬盘进行分区。

#fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 69.7 GB, 69793218560 bytes

255 heads, 63 sectors/track, 8485 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device

Boot Start End Blocks Id System

/dev/sda1 * 1 1305 10482381 83 Linux

/dev/sda2 1829 5221 27254272+ 83 Linux

/dev/sda3 1306 1827 4192965 83 Linux

Partition table entries are not in disk order

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Selected partition 4

First cylinder (1828-8485, default 1828): 5222

Last cylinder or +size or +sizeM or +sizeK (5222-8485, default

8485): 7309

Command (m for help): t

Partition number (1-4): 4

Hex code (type L to list codes): 82

Changed system type of partition 4 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/sda: 69.7 GB, 69793218560 bytes

255 heads, 63 sectors/track, 8485 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device

Boot Start End Blocks Id System

/dev/sda1 * 1 1305 10482381 83 Linux

/dev/sda2 1829 5221 27254272+ 83 Linux

/dev/sda3 1306 1827 4192965 83 Linux

/dev/sda4 5222 7309 16771860 82 Linux swap / Solaris

Partition table entries are not in disk order

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): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16:

Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

[root@ENGtest sbin]# df -k

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda1 10153988 3347580 6282292 35% /

/dev/sda3 4061572 3432952 418972 90% /worktmp

/dev/sda2 26400508 7456328 17581468 30%

/oracle

tmpfs 3936180 0 3936180 0% /dev/shm

/dev/sdb 205392632 191892 194767412 1%

/oracledata1

/dev/sdc 205392632 191892 194767412 1%

/oracledata2

/dev/sdd 137272424 192132 130107264 1%

/oracledata3

[root@ENGtest sbin]# fdisk -l /dev/sda

Disk /dev/sda: 69.7 GB, 69793218560 bytes

255 heads, 63 sectors/track, 8485 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device

Boot Start End Blocks Id System

/dev/sda1 * 1 1305 10482381 83 Linux

/dev/sda2 1829 5221 27254272+ 83 Linux

/dev/sda3 1306 1827 4192965 83 Linux

/dev/sda4 5222 7309 16771860 82 Linux swap / Solaris

Partition table entries are not in disk order

2、建立swap分区,并且进行加载。

[root@ENGtest /]#

[root@ENGtest /]# fdisk -l /dev/sda

Disk /dev/sda: 69.7 GB, 69793218560 bytes

255 heads, 63 sectors/track, 8485 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device

Boot Start End Blocks Id System

/dev/sda1 * 1 1305 10482381 83 Linux

/dev/sda2 1829 5221 27254272+ 83 Linux

/dev/sda3 1306 1827 4192965 83 Linux

/dev/sda4 5222 7309 16771860 82 Linux swap / Solaris

Partition table entries are not in disk order

[root@ENGtest /]# ls -l

total 392

drwxr-xr-x 2

root root 4096 Dec 30 13:32 bin

drwxr-xr-x 3

root root 4096 Dec 30 19:59 boot

drwxr-xr-x 11

root root 3800 Feb 2 16:23 dev

drwxr-xr-x 100 root root 12288 Feb 2 16:30 etc

drwxr-xr-x 5

root root 4096 Jan 9 21:14 home

drwxr-xr-x 2

root root 4096 Jan 21 10:59 install_doc

drwxr-xr-x 12

root root 4096 Jan 17 04:02 lib

drwxr-xr-x 8

root root 4096 Dec 30 13:31 lib64

drwx------ 2

root root 16384 Dec 30 19:53 lost+found

drwxr-xr-x 2

root root 4096 Feb 2 16:23 media

drwxr-xr-x 2

root root 0 Feb 2 16:23 misc

drwxr-xr-x 4

root root 4096 Jan 15 16:42 mnt

drwxr-xr-x 2

root root 0 Feb 2 16:23 net

drwxr-xr-x 2

root root 4096 Oct 11 2006 opt

drwxr-xr-x 6 oracle

oinstall 4096 Jan 22 10:54

oracle

drwxr-xr-x 3

root root 4096 Jan 9 16:22 oracledata1

drwxr-xr-x 3

root root 4096 Jan 9 16:35 oracledata2

drwxr-xr-x 3

root root 4096 Jan 9 16:41 oracledata3

dr-xr-xr-x 150 root root 0 Feb 2 16:22 proc

drwxr-x--- 23

root root 4096 Feb 2 16:23 root

drwxr-xr-x 2

root root 12288 Feb 2 16:23 sbin

-rw-r--r-- 1

root root 199516 Jan 21 10:58 Screenshot-Oracle Database 10g Installation -

Installation Method.png

drwxr-xr-x 4

root root 0 Feb 2 16:22 selinux

drwxr-xr-x 2

root root

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值