歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在Linux使用ext2resize在線擴展文件系統

在Linux使用ext2resize在線擴展文件系統

日期:2017/2/28 15:42:51   编辑:Linux教程

一個做Oracle的工程師,筆記本上居然沒有一套Oracle環境,說起來還真搞笑。今天要幫老婆倒騰一些數據,沒辦法,只好先裝一套Oracle。在筆記本上已經有一個linux的虛擬機,本來是裝DB2的,懶得再重裝OS了,打算就在裡面裝Oracle。

整個系統就一個文件系統,再裝完11g軟件後,准備建庫時發現沒有空間了,數據庫就裝在根目錄下,於是打算給根卷劃一些空間,然後在線擴展文件系統。

這次准備用ext2resize工具在線擴展文件系統。

環境:
[root@ www.linuxidc.com ~]# uname -a
Linux cheneydb2 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

[root@ www.linuxidc.com ~]# cat /etc/RedHat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

工具下載路徑:
ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/openSUSE/repositories/home:/janptitan/SLE_10/x86_64/ext2resize-1.1.19-3.1.x86_64.rpm

劃盤:
[root@ www.linuxidc.com ~]# fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1958 15623212+ 8e Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

磁盤分區:

[root@ www.linuxidc.com ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): h
h: unknown command
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):
Using default value 652

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

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

[root@ www.linuxidc.com ~]# fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1958 15623212+ 8e Linux LVM

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 652 5237158+ 83 Linux

Copyright © Linux教程網 All Rights Reserved