- 最后登录
- 2019-7-8
- 在线时间
- 133 小时
- 威望
- 131
- 金钱
- 1368
- 注册时间
- 2011-10-14
- 阅读权限
- 50
- 帖子
- 126
- 精华
- 1
- 积分
- 131
- UID
- 31
|
1#
发表于 2012-5-10 11:23:55
|
查看: 4784 |
回复: 2
在安装系统的时候使用默认的分区安装的,结果发现swap区有点大,想缩小一下
- [root@oracle11g-std mapper]# uname -a
- Linux oracle11g-std 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
- [root@oracle11g-std mapper]# lvdisplay
- --- Logical volume ---
- LV Name /dev/vg_oracle11gstd/lv_root
- VG Name vg_oracle11gstd
- LV UUID ICHlPw-t84Z-5CKo-dZmC-s9zV-65tB-Fowgyt
- LV Write Access read/write
- LV Status available
- # open 1
- LV Size 17.98 GiB
- Current LE 4602
- Segments 1
- Allocation inherit
- Read ahead sectors auto
- - currently set to 256
- Block device 253:0
-
- --- Logical volume ---
- LV Name /dev/vg_oracle11gstd/lv_swap
- VG Name vg_oracle11gstd
- LV UUID iVSDgb-BQc0-cZHP-1xCt-KZ91-vcdM-uW0y8g
- LV Write Access read/write
- LV Status available
- # open 1
- LV Size 1.53 GiB
- Current LE 392
- Segments 1
- Allocation inherit
- Read ahead sectors auto
- - currently set to 256
- Block device 253:1
- [root@oracle11g-std mapper]# lvreduce -L 500M -f -r /dev/vg_oracle11gstd/lv_swap
- fsck from util-linux-ng 2.17.2
- fsck: fsck.swap: not found
- fsck: Error 2 while executing fsck.swap for /dev/mapper/vg_oracle11gstd-lv_swap
- fsadm: Filesystem "swap" on device "/dev/dm-1" is not supported by this tool
- fsadm failed: 1
- [root@oracle11g-std mapper]# more /etc/fstab
- #
- # /etc/fstab
- # Created by anaconda on Wed Apr 25 00:36:24 2012
- #
- # Accessible filesystems, by reference, are maintained under '/dev/disk'
- # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
- #
- /dev/mapper/vg_oracle11gstd-lv_root / ext4 defaults 1 1
- UUID=fe90813a-a61f-4208-b6a8-c3d178229ded /boot ext4 defaults 1 2
- /dev/mapper/vg_oracle11gstd-lv_swap swap swap defaults 0 0
- tmpfs /dev/shm tmpfs defaults 0 0
- devpts /dev/pts devpts gid=5,mode=620 0 0
- sysfs /sys sysfs defaults 0 0
- proc /proc proc defaults 0 0
- [root@oracle11g-std mapper]# ll -l /dev/mapper/vg_oracle11gstd-lv_swap swap
- ls: 无法访问swap: 没有那个文件或目录
- lrwxrwxrwx. 1 root root 7 5月 10 19:13 /dev/mapper/vg_oracle11gstd-lv_swap -> ../dm-1
- [root@oracle11g-std mapper]#
复制代码
请问改如何缩小swap的大小,多谢啊 |
|