Linux下調(diào)整根目錄的空間大小

一悠瞬、目的

在使用CentOS6.3版本linux系統(tǒng)的時候昵骤,發(fā)現(xiàn)根目錄(/)的空間不是很充足,而其他目錄空間有很大的空閑交惯,所以本文主要是針對現(xiàn)在已有的空間進(jìn)行調(diào)整次泽。首先,先來查看一下系統(tǒng)的空間分配情況:

[root@CentOS-78?/]#?df?-h

Filesystem????????????Size??Used?Avail?Use%?Mounted?on

/dev/mapper/vg_centos-lv_root

50G???14G???34G??30%?/

tmpfs?????????????????1.9G?????0??1.9G???0%?/dev/shm

/dev/sda1?????????????485M???37M??423M???8%?/boot

/dev/mapper/vg_centos-lv_home

404G??670M??382G???1%?/home

下面的詳細(xì)步驟部分將從vg_centos-lv_home分區(qū)下取出100G的空間添加到/vg_centos-lv_root分區(qū)上去席爽。

二意荤、詳細(xì)步驟

1、卸載vg_centos-lv_home分區(qū)

[root@CentOS-78?/]#?umount?/home

此時在用df命令查看將會發(fā)現(xiàn)/home目錄已經(jīng)看不見了只锻,如下所示:

[root@CentOS-78?/]#?df?-h

Filesystem????????????Size??Used?Avail?Use%?Mounted?on

/dev/mapper/vg_centos-lv_root

50G???14G???34G??30%?/

tmpfs?????????????????1.9G?????0??1.9G???0%?/dev/shm

/dev/sda1?????????????485M???37M??423M???8%?/boot

2玖像、從新設(shè)定vg_home-lv_home的大小

[root@CentOS-78?/]#?resize2fs?-p?/dev/mapper/vg_centos-lv_home?282G

resize2fs?1.41.12?(17-May-2010)

Please?run?'e2fsck?-f?/dev/mapper/vg_centos-lv_home'?first.

這一步設(shè)定vg_home-lv_home大小沒有成功,系統(tǒng)提示我們先運行下面的命令齐饮,操作如下:

[root@CentOS-78?/]#?e2fsck?-f?/dev/mapper/vg_centos-lv_home

e2fsck?1.41.12?(17-May-2010)

Pass?1:?Checking?inodes,?blocks,?and?sizes

Pass?2:?Checking?directory?structure

Pass?3:?Checking?directory?connectivity

Pass?4:?Checking?reference?counts

Pass?5:?Checking?group?summary?information

/dev/mapper/vg_centos-lv_home:?1386/26836992?files?(0.9%?non-contiguous),?1855856/107344896?blocks

從新設(shè)定vg_home-lv_home的大芯枇取:

[root@CentOS-78?/]#?resize2fs?-p?/dev/mapper/vg_centos-lv_home?282G

resize2fs?1.41.12?(17-May-2010)

Resizing?the?filesystem?on?/dev/mapper/vg_centos-lv_home?to?73924608?(4k)?blocks.

Begin?pass?2?(max?=?43)

Relocating?blocks?????????????XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Begin?pass?3?(max?=?3276)

Scanning?inode?table??????????XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Begin?pass?4?(max?=?266)

Updating?inode?references?????XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The?filesystem?on?/dev/mapper/vg_centos-lv_home?is?now?73924608?blocks?long.

檢查是否成功:

[root@CentOS-78?/]#?mount?/home

[root@CentOS-78?/]#

[root@CentOS-78?/]#?df?-h

Filesystem????????????Size??Used?Avail?Use%?Mounted?on

/dev/mapper/vg_centos-lv_root

50G???14G???34G??30%?/

tmpfs?????????????????1.9G?????0??1.9G???0%?/dev/shm

/dev/sda1?????????????485M???37M??423M???8%?/boot

/dev/mapper/vg_centos-lv_home

278G??663M??263G???1%?/home

[root@CentOS-78?/]#

3、將lv_home邏輯分區(qū)減小到指定大小

[root@CentOS-78?/]#?lvreduce?-L?282G?/dev/mapper/vg_centos-lv_home

WARNING:?Reducing?active?and?open?logical?volume?to?282.00?GiB

THIS?MAY?DESTROY?YOUR?DATA?(filesystem?etc.)

Do?you?really?want?to?reduce?lv_home??[y/n]:?y

Reducing?logical?volume?lv_home?to?282.00?GiB

Logical?volume?lv_home?successfully?resized

[root@CentOS-78?/]#

我認(rèn)為這個命令是將已經(jīng)減少的100G空間拿到系統(tǒng)公共的區(qū)域祖驱,可以被其他分區(qū)加載和利用握恳。

查詢卷組的信息:

[root@CentOS-78?/]#?vgdisplay

---?Volume?group?---

VG?Name???????????????vg_centos

System?ID

Format????????????????lvm2

Metadata?Areas????????1

Metadata?Sequence?No??5

VG?Access?????????????read/write

VG?Status?????????????resizable

MAX?LV????????????????0

Cur?LV????????????????3

Open?LV???????????????3

Max?PV????????????????0

Cur?PV????????????????1

Act?PV????????????????1

VG?Size???????????????465.27?GiB

PE?Size???????????????4.00?MiB

Total?PE??????????????119109

Alloc?PE?/?Size???????86472?/?337.78?GiB

Free??PE?/?Size???????32637?/?127.49?GiB

VG?UUID???????????????1k4ooN-RFV9-uyf1-uMYf-aERG-YaGs-ZNoSD6

Free PE / Size指定的應(yīng)該是現(xiàn)在可在分配的空間。

4捺僻、增加vg_centos-lv_root分區(qū)的大小

將可用的空間添加到vg_centos-lv_root分區(qū)上面:

[root@CentOS-78?/]#?lvextend?-L?+127.40G?/dev/mapper/vg_centos-lv_root

Rounding?up?size?to?full?physical?extent?127.40?GiB

Extending?logical?volume?lv_root?to?177.40?GiB

Logical?volume?lv_root?successfully?resized

[root@CentOS-78?/]#

從新設(shè)定該分區(qū)的大兴ァ:

[root@CentOS-78?/]#?resize2fs?-p?/dev/mapper/vg_centos-lv_root

resize2fs?1.41.12?(17-May-2010)

Filesystem?at?/dev/mapper/vg_centos-lv_root?is?mounted?on?/;?on-line?resizing?required

old?desc_blocks?=?4,?new_desc_blocks?=?12

Performing?an?on-line?resize?of?/dev/mapper/vg_centos-lv_root?to?46504960?(4k)?blocks.

The?filesystem?on?/dev/mapper/vg_centos-lv_root?is?now?46504960?blocks?long.

5、再次查看分區(qū)大小

[root@CentOS-78?/]#?df?-h

Filesystem????????????Size??Used?Avail?Use%?Mounted?on

/dev/mapper/vg_centos-lv_root

175G???14G??153G???9%?/

tmpfs?????????????????1.9G?????0??1.9G???0%?/dev/shm

/dev/sda1?????????????485M???37M??423M???8%?/boot

/dev/mapper/vg_centos-lv_home

278G??663M??263G???1%?/home

我們發(fā)現(xiàn)vg_centos-lv_root分區(qū)的空間已經(jīng)增加了125G陵像,之所以比lv_home減少的空間要多25G主要是由于我們把系統(tǒng)所有的可用的空間都加在了lv_root分區(qū)就珠。

三、所遇到的問題

1醒颖、在卸載/home目錄的時候失敗

可先執(zhí)行如下fuser命令妻怎,然后再umount即可:

[root@CentOS-78?/]#?fuser?-m?/home

[root@CentOS-78?/]#

2、設(shè)定完lv_home的大小泞歉,再次mount該分區(qū)時逼侦,發(fā)現(xiàn)用df命令無法看到給分區(qū)匿辩,此時只要在mount一次即可

3、在設(shè)定lv_root的大小時榛丢,不要把Free PE / Size的空間全部都用上铲球,這很可能會出現(xiàn)Free PE空間不足的現(xiàn)象,建議保留一點Free PE的空間晰赞。

在Fedora13-x86_64 擴展 VolGroup-lv_root 分區(qū).

在使用Fedora13-x86_64過程中,發(fā)現(xiàn)系統(tǒng)分配給root用戶lvm份額太少.

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

50G 11G 37G 23% /

tmpfs 878M 100K 878M 1% /dev/shm

/dev/sda1 485M 28M 432M 7% /boot

/dev/mapper/VolGroup-lv_home

406G 411M 385G 1% /home

/dev/sdc 124M 107M 18M 86% /media/16F0-286F

[root@localhost ~]#

總共才50G,決定給它增加份額,現(xiàn)做好重要文件備份,以防萬一.

思路:

先減掉VolGroup-lv_home的份額,再把減掉份額增加到VolGroup-lv_root.

[root@localhost ~]# pvscan

PV /dev/sda2 VG VolGroup lvm2 [465.25 GiB / 0 free]

Total: 1 [465.25 GiB] / in use: 1 [465.25 GiB] / in no VG: 0 [0 ]

[root@localhost ~]# resize2fs -p /dev/mapper/VolGroup-lv_home 206G

resize2fs 1.41.10 (10-Feb-2009)

Filesystem at /dev/mapper/VolGroup-lv_home is mounted on /home; on-line resizing required

On-line shrinking from 107954176 to 54001664 not supported.

[root@localhost ~]# umount /home

[root@localhost ~]# resize2fs -p /dev/mapper/VolGroup-lv_home 206G

resize2fs 1.41.10 (10-Feb-2009)

Please run 'e2fsck -f /dev/mapper/VolGroup-lv_home' first.

[root@localhost ~]# e2fsck -f /dev/mapper/VolGroup-lv_home

e2fsck 1.41.10 (10-Feb-2009)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Pass 5: Checking group summary information

/dev/mapper/VolGroup-lv_home: 1534/26992640 files (1.2% non-contiguous), 1799101/107954176 blocks

[root@localhost ~]# resize2fs -p /dev/mapper/VolGroup-lv_home 206G

resize2fs 1.41.10 (10-Feb-2009)

Resizing the filesystem on /dev/mapper/VolGroup-lv_home to 54001664 (4k) blocks.

Begin pass 3 (max = 3295)

Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The filesystem on /dev/mapper/VolGroup-lv_home is now 54001664 blocks long.

[root@localhost ~]# mount /home

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

50G 11G 37G 23% /

tmpfs 878M 100K 878M 1% /dev/shm

/dev/sda1 485M 28M 432M 7% /boot

/dev/sdc 124M 107M 18M 86% /media/16F0-286F

/dev/mapper/VolGroup-lv_home

203G 400M 193G 1% /home

[root@localhost ~]# lvreduce -L 206G /dev/mapper/VolGroup-lv_home

WARNING: Reducing active and open logical volume to 206.00 GiB

THIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce lv_home? [y/n]: y

Reducing logical volume lv_home to 206.00 GiB

Logical volume lv_home successfully resized

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

50G 11G 37G 23% /

tmpfs 878M 100K 878M 1% /dev/shm

/dev/sda1 485M 28M 432M 7% /boot

/dev/sdc 124M 107M 18M 86% /media/16F0-286F

/dev/mapper/VolGroup-lv_home

203G 400M 193G 1% /home

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name VolGroup

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 5

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 3

Open LV 3

Max PV 0

Cur PV 1

Act PV 1

VG Size 465.25 GiB

PE Size 32.00 MiB

Total PE 14888

Alloc PE / Size 8302 / 259.44 GiB

Free PE / Size 6586 / 205.81 GiB

VG UUID ymBJK0-SNdq-DWHg-MlPu-31sG-ZpO1-kCrUmu

[root@localhost ~]# man lvextend

[root@localhost ~]# lvextend -L +205.81G /dev/mapper/VolGroup-lv_root

Rounding up size to full physical extent 205.81 GiB

Extending logical volume lv_root to 255.81 GiB

Logical volume lv_root successfully resized

[root@localhost ~]# resize2fs -p /dev/mapper/VolGroup-lv_root

resize2fs 1.41.10 (10-Feb-2009)

Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required

old desc_blocks = 4, new_desc_blocks = 16

Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 67059712 (4k) blocks.

The filesystem on /dev/mapper/VolGroup-lv_root is now 67059712 blocks long.

讓我們看一下,

[root@localhost ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

252G 11G 229G 5% /

tmpfs 878M 100K 878M 1% /dev/shm

/dev/sda1 485M 28M 432M 7% /boot

/dev/sdc 124M 107M 18M 86% /media/16F0-286F

/dev/mapper/VolGroup-lv_home

203G 400M 193G 1% /home

[root@localhost ~]#

已經(jīng)可以了.

linux增加根目錄的磁盤空間(LVM)

第一步:添加磁盤

第二步:使用Linux下的fdisk工具進(jìn)行分區(qū)

用root用戶登錄:

打印當(dāng)前的磁盤分區(qū)表稼病,這時我們可以看到磁盤的總量的確增加到30GB 了,但是分區(qū)只有以前的那幾個原有的分區(qū)

[root@localhost ~]# fdisk -l

鍵入命令: fdisk /dev/sda?? “sda 就是經(jīng)過擴容的硬盤掖鱼,為 SCSI 硬盤然走, IDE 類型硬盤對應(yīng)為 hda ,是對該硬盤進(jìn)行操作 ”

選擇主分區(qū)吧戏挡,則鍵入 p

此時芍瑞, fdisk 會讓你選擇主分區(qū)的編號,如果已經(jīng)有了主分區(qū) sda1 褐墅, sda2 拆檬,那么編號就選3 ,即要創(chuàng)建的該分區(qū)為 sda3.

鍵入:???? 3

此時妥凳, fdisk 又會讓你選擇該分區(qū)的開始值這個就是分區(qū)的 Start 值( start cylinder )竟贯;這里最好直接按回車, 如果您輸入了一個非默認(rèn)的數(shù)字猾封,可能會造成空間浪費澄耍;

對于分區(qū)的 End 值(end cylinder),同樣直接按回車晌缘。這時候會顯示出你新建分區(qū)的柱面范圍和空間大小齐莲。

此時鍵入: w??? 表示" 保存所有并退出,分區(qū)劃分完畢 "

[root@localhost ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3916.

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

Command action

e ? extended

p ? primary partition (1-4)

p

Partition number (1-4): 3

First cylinder (1045-3916, default 1045):

Using default value 1045

Last cylinder or +size or +sizeM or +sizeK (1045-3916, default 3916):

Using default value 3916

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: 設(shè)備或資源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

我們的新建分區(qū)/dev/sda3磷箕,卻不是LVM的选酗。所以,接下來使用fdisk將其改成LVM的岳枷。

[root@CNGI-SIP6-BUPT ~]# fdisk /dev/sda

Command (m for help): m

Command (m for help): t //改變分區(qū)系統(tǒng)id

Partition number (1-4): 3 //指定分區(qū)號

Hex code (type L to list codes): 8e //指定要改成的id號芒填,8e代表LVM。

Command (m for help): w

[root@localhost ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 3916.

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

Partition number (1-4): 3

Hex code (type L to list codes): 8e

Changed system type of partition 3 to 8e (Linux LVM)

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: 設(shè)備或資源忙.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

重新登錄后:

[root@localhost ~]# reboot

Broadcast message from root (pts/1) (Thu Sep 22 09:54:45 2011):

The system is going down for reboot NOW!

[root@localhost ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes

255 heads, 63 sectors/track, 3916 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 ? ? ? ?1044 ? ? 8281507+ ?8e ?Linux LVM

/dev/sda3 ? ? ? ? ? ?1045 ? ? ? ?3916 ? ?23069340 ? 8e ?Linux LVM

Disk /dev/sdb: 6442 MB, 6442450944 bytes

255 heads, 63 sectors/track, 783 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot ? ? ?Start ? ? ? ? End ? ? ?Blocks ? Id ?System

/dev/sdb1 ? ? ? ? ? ? ? 1 ? ? ? ? 783 ? ? 6289416 ? 83 ?Linux

第三步空繁、格式化該新添加的分區(qū)

格式化磁盤

[root@localhost ~]# mkfs -t ext3 /dev/sda3

mke2fs 1.35 (28-Feb-2004)

max_blocks 4294967295, rsv_groups = 0, rsv_gdb = 1024

max_blocks 4294967295, rsv_groups = 0, rsv_gdb = 1024

warning: 167 blocks unused.

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2889216 inodes, 5767168 blocks

288366 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=8388608

176 block groups

32768 blocks per group, 32768 fragments per group

16416 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

4096000

Writing inode tables: done

inode.i_blocks = 90120, i_size = 4243456

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or

180 days, whichever comes first. ?Use tune2fs -c or -i to override.

第四步殿衰、擴充根分區(qū)

[root@localhost ~]# lvs

LV ? ? ? VG ? ? ? ? Attr ? LSize Origin Snap% ?Move Copy%

LogVol00 VolGroup00 -wi-ao 5.91G

LogVol01 VolGroup00 -wi-ao 1.94G

[root@localhost ~]# pvcreate /dev/sd

sda ? sda1 ?sda2 ?sda3 ?sdb ? sdb1

[root@localhost ~]# pvcreate /dev/sda3

Physical volume "/dev/sda3" successfully created

[root@localhost ~]# df -h

Filesystem ? ? ? ? ? ?容量 ?已用 可用 已用% 掛載點

/dev/mapper/VolGroup00-LogVol00

5.9G ?5.5G ?120M ?98% /

/dev/sda1 ? ? ? ? ? ? ?99M ?9.0M ? 85M ?10% /boot

none ? ? ? ? ? ? ? ? ?506M ? ? 0 ?506M ? 0% /dev/shm

/dev/sdb1 ? ? ? ? ? ? 6.0G ?347M ?5.3G ? 7% /disk2

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name ? ? ? ? ? ? ? VolGroup00

System ID

Format ? ? ? ? ? ? ? ?lvm2

Metadata Areas ? ? ? ?1

Metadata Sequence No ?3

VG Access ? ? ? ? ? ? read/write

VG Status ? ? ? ? ? ? resizable

MAX LV ? ? ? ? ? ? ? ?0

Cur LV ? ? ? ? ? ? ? ?2

Open LV ? ? ? ? ? ? ? 2

Max PV ? ? ? ? ? ? ? ?0

Cur PV ? ? ? ? ? ? ? ?1

Act PV ? ? ? ? ? ? ? ?1

VG Size ? ? ? ? ? ? ? 7.88 GB

PE Size ? ? ? ? ? ? ? 32.00 MB

Total PE ? ? ? ? ? ? ?252

Alloc PE / Size ? ? ? 251 / 7.84 GB

Free ?PE / Size ? ? ? 1 / 32.00 MB

VG UUID ? ? ? ? ? ? ? HvKxmm-WazL-TjFN-yXNH-ui8U-pcl9-Pk6psB

[root@localhost ~]# vgextend VolGroup00 /dev/sda3

Volume group "VolGroup00" successfully extended

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name ? ? ? ? ? ? ? VolGroup00

System ID

Format ? ? ? ? ? ? ? ?lvm2

Metadata Areas ? ? ? ?2

Metadata Sequence No ?4

VG Access ? ? ? ? ? ? read/write

VG Status ? ? ? ? ? ? resizable

MAX LV ? ? ? ? ? ? ? ?0

Cur LV ? ? ? ? ? ? ? ?2

Open LV ? ? ? ? ? ? ? 2

Max PV ? ? ? ? ? ? ? ?0

Cur PV ? ? ? ? ? ? ? ?2

Act PV ? ? ? ? ? ? ? ?2

VG Size ? ? ? ? ? ? ? 29.88 GB

PE Size ? ? ? ? ? ? ? 32.00 MB

Total PE ? ? ? ? ? ? ?956

Alloc PE / Size ? ? ? 251 / 7.84 GB

Free ?PE / Size ? ? ? 705 / 22.03 GB

VG UUID ? ? ? ? ? ? ? HvKxmm-WazL-TjFN-yXNH-ui8U-pcl9-Pk6psB

#不能把 ??Free ?PE / Size ? ? ? 705 / 22.03 GB的空間全部加上,應(yīng)該下雨22.03

[root@localhost ~]# lvextend -L+22.03G /dev/VolGroup00/LogVol00 /dev/sda3

Rounding up size to full physical extent 22.03 GB

Extending logical volume LogVol00 to 27.94 GB

Insufficient allocatable logical extents (893) for logical volume LogVol00: 894 required

[root@localhost ~]# lvextend -L+21.03G /dev/VolGroup00/LogVol00 /dev/sda3

Rounding up size to full physical extent 21.03 GB

Extending logical volume LogVol00 to 26.94 GB

Logical volume LogVol00 successfully resized

[root@localhost ~]# cat /etc/fstab

# This file is edited by fstab-sync - see 'man fstab-sync' for details

/dev/VolGroup00/LogVol00 / ? ? ? ? ? ? ? ? ? ? ? ext3 ? ?defaults ? ? ? ?1 1

LABEL=/boot ? ? ? ? ? ? /boot ? ? ? ? ? ? ? ? ? ext3 ? ?defaults ? ? ? ?1 2

none ? ? ? ? ? ? ? ? ? ?/dev/pts ? ? ? ? ? ? ? ?devpts ?gid=5,mode=620 ?0 0

none ? ? ? ? ? ? ? ? ? ?/dev/shm ? ? ? ? ? ? ? ?tmpfs ? defaults ? ? ? ?0 0

none ? ? ? ? ? ? ? ? ? ?/proc ? ? ? ? ? ? ? ? ? proc ? ?defaults ? ? ? ?0 0

none ? ? ? ? ? ? ? ? ? ?/sys ? ? ? ? ? ? ? ? ? ?sysfs ? defaults ? ? ? ?0 0

/dev/VolGroup00/LogVol01 swap ? ? ? ? ? ? ? ? ? ?swap ? ?defaults ? ? ? ?0 0

/dev/sdb1 ? ? ? /disk2 ?ext3 ? ?defaults ? ? ? ?1 1

/dev/hdc ? ? ? ? ? ? ? ?/media/cdrom ? ? ? ? ? ?auto ? ?pamconsole,exec,noauto,managed 0 0

/dev/fd0 ? ? ? ? ? ? ? ?/media/floppy ? ? ? ? ? auto ? ?pamconsole,exec,noauto,managed 0 0

[root@localhost ~]# e2fsck -a /dev/VolGroup00/LogVol00

/dev/VolGroup00/LogVol00 is mounted.

WARNING!!! ?Running e2fsck on a mounted filesystem may cause

SEVERE filesystem damage.

Do you really want to continue (y/n)? yes

/dev/VolGroup00/LogVol00: recovering journal

/dev/VolGroup00/LogVol00: Clearing orphaned inode 596983 (uid=501, gid=501, mode=0100660, size=0)

/dev/VolGroup00/LogVol00: clean, 144094/774144 files, 1440278/1548288 blocks

#redhat4 沒有resize2fs命令

[root@localhost ~]# resize2fs

-bash: resize2fs: command not found

#redhat4下用ext2online

[root@localhost ~]# ext2online /dev/VolGroup00/LogVol00

ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b

[root@localhost ~]# df -h

Filesystem ? ? ? ? ? ?容量 ?已用 可用 已用% 掛載點

/dev/mapper/VolGroup00-LogVol00

27G ?5.5G ? 20G ?22% /

/dev/sda1 ? ? ? ? ? ? ?99M ?9.0M ? 85M ?10% /boot

none ? ? ? ? ? ? ? ? ?506M ? ? 0 ?506M ? 0% /dev/shm

/dev/sdb1 ? ? ? ? ? ? 6.0G ?347M ?5.3G ? 7% /disk2

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末盛泡,一起剝皮案震驚了整個濱河市闷祥,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌傲诵,老刑警劉巖凯砍,帶你破解...
    沈念sama閱讀 223,207評論 6 521
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件箱硕,死亡現(xiàn)場離奇詭異,居然都是意外死亡悟衩,警方通過查閱死者的電腦和手機剧罩,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,455評論 3 400
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來座泳,“玉大人惠昔,你說我怎么就攤上這事∏ィ” “怎么了舰罚?”我有些...
    開封第一講書人閱讀 170,031評論 0 366
  • 文/不壞的土叔 我叫張陵纽门,是天一觀的道長薛耻。 經(jīng)常有香客問我,道長赏陵,這世上最難降的妖魔是什么饼齿? 我笑而不...
    開封第一講書人閱讀 60,334評論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮蝙搔,結(jié)果婚禮上缕溉,老公的妹妹穿的比我還像新娘。我一直安慰自己吃型,他們只是感情好证鸥,可當(dāng)我...
    茶點故事閱讀 69,322評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著勤晚,像睡著了一般枉层。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上赐写,一...
    開封第一講書人閱讀 52,895評論 1 314
  • 那天鸟蜡,我揣著相機與錄音,去河邊找鬼挺邀。 笑死揉忘,一個胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的端铛。 我是一名探鬼主播泣矛,決...
    沈念sama閱讀 41,300評論 3 424
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼禾蚕!你這毒婦竟也來了您朽?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 40,264評論 0 277
  • 序言:老撾萬榮一對情侶失蹤夕膀,失蹤者是張志新(化名)和其女友劉穎虚倒,沒想到半個月后美侦,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,784評論 1 321
  • 正文 獨居荒郊野嶺守林人離奇死亡魂奥,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 38,870評論 3 343
  • 正文 我和宋清朗相戀三年菠剩,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片耻煤。...
    茶點故事閱讀 40,989評論 1 354
  • 序言:一個原本活蹦亂跳的男人離奇死亡具壮,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出哈蝇,到底是詐尸還是另有隱情棺妓,我是刑警寧澤,帶...
    沈念sama閱讀 36,649評論 5 351
  • 正文 年R本政府宣布炮赦,位于F島的核電站怜跑,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏吠勘。R本人自食惡果不足惜性芬,卻給世界環(huán)境...
    茶點故事閱讀 42,331評論 3 336
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望剧防。 院中可真熱鬧植锉,春花似錦、人聲如沸峭拘。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,814評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽鸡挠。三九已至辉饱,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間宵凌,已是汗流浹背鞋囊。 一陣腳步聲響...
    開封第一講書人閱讀 33,940評論 1 275
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留瞎惫,地道東北人溜腐。 一個月前我還...
    沈念sama閱讀 49,452評論 3 379
  • 正文 我出身青樓,卻偏偏與公主長得像瓜喇,于是被迫代替她去往敵國和親挺益。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 45,995評論 2 361

推薦閱讀更多精彩內(nèi)容