当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 2 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 调整swap分区大小后,可以休眠却不能正常唤醒问题(解决办法)
帖子发表于 : 2009-10-23 8:43 
头像

注册: 2007-03-23 18:06
帖子: 269
送出感谢: 0 次
接收感谢: 0 次
我的本子有2G的内存,安装9.10beta时,我分了2G的分区作为swap,1G给/tmp,后来发现这两个分区的利用率太低,就打算把/tmp用tmpfs挂载,把swap调整为1G,只要能保证休眠就够了。调整完后(漫长的等待!!!),发现休眠可以,但唤醒是变成了重新启动。
放狗后,找到这样一篇文章:[url]http://www.bamweb.nl/index.php?Itemid=4&id=150&option=com_content&task=view
[/url]是关于增加swap分区大小的。我发现我应该是少作了一步,大意如下:
在这篇文章中,记录了扩大swap分区的方式和过程,主要有以下几点:

1.使用gparted

2.卸载要处理的分区

3.调整(时间很长)

4.改变配置—-注意

a.用blkid查找相应的改变后的UUID

b.在fstab中改变相应的值

c.在/etc/initramfs-tools/conf.d/resum中,改变swap分区的UUID,这是作为重启动时首先指向的分区3

d.重新生成initramfs,sudo update-initramfs -k all -u 注:这里用”all”是因为我用了两个内核。

以上红字的部份就是我少做了的,做了这一部后就可以正常唤醒了。
附我的配置文件:

1.fstab

# /etc/fstab: static file system information.
#
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda1 during installation
UUID=af04b906-1761-4047-96ef-2758d7c3bc4c / ext4 errors=remount-ro 0 1
# /home was on /dev/sda4 during installation
UUID=7c9da8c9-426d-47ea-b91b-d7dde31fa215 /home ext4 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=4c0f4d3f-07e3-4150-ae20-4e9ad8db1ad4 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
none /tmp tmpfs defaults,size=256m 0 0
none /var/tmp tmpfs defaults,size=32m 00
2./etc/initramfs-tools/conf.d/resum

RESUME=UUID=4c0f4d3f-07e3-4150-ae20-4e9ad8db1ad4

以下为原文:

**********************************************************************************************************************************************************

After this we will use the UUID in the /etc/fstab and in /etc/initramfs-tools/conf.d/resume. Now we are going to reinitialize the ramfs by using this command:

通过Ubuntu, swap, hibernate.

Just a couple of days ago I wanted to increase my swap space to 1 GB instead of 512 MB. This way I could finally do an hibernate. Most of the time I wasn’t able to because I have 1 GB of RAM and with firefox and thunderbird running it uses a lot.

So what did I do. I installed Gparted to adjust my disks. As you can see further below my swap partition is for my biggest partition. So I had to resize and move my data a bit to the right so I could grew my swap partition. Make sure do this when you have enough time. I took me around 3 hours. The following commands where used.

apt-get install gparted

Make sure you have unmounted the partition you want to edit, you are also able to do it with Gparted, but it crashed on my machine. So I did it by hand. NOTE: remember the partition you are using.

System > Administration > Partition Editor

Now we are going to create the swap partition.

mkswap /dev/sda5

After this we will use the UUID in the /etc/fstab and in /etc/initramfs-tools/conf.d/resume. Now we are going to reinitialize the ramfs by using this command:

update-initramfs -u

After this has finished you may reboot normally.
Extra information

The following commands may help you during the way.

# fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0×8f8002b1

Device Boot Start End Blocks Id System
/dev/sda1 1 12 96358+ de Dell Utility
/dev/sda2 * 13 1290 10265535 7 HPFS/NTFS
/dev/sda3 1291 2197 7285477+ 83 Linux
/dev/sda4 2198 7296 40957717+ 5 Extended
/dev/sda5 2198 2327 1044193+ 82 Linux swap / Solaris
/dev/sda6 2328 7296 39913461 83 Linux

# blkid
/dev/sda1: SEC_TYPE=”msdos” LABEL=”DellUtility” UUID=”07D5-081A” TYPE=”vfat”
/dev/sda2: UUID=”66DC7E18DC7DE2AB” TYPE=”ntfs”
/dev/sda3: UUID=”51853ab8-929e-4c6e-ada7-f8da01e2d18a” SEC_TYPE=”ext2″ TYPE=”ext3″
/dev/sda5: TYPE=”swap” UUID=”34c13693-7a5d-4274-a002-623cc82b062d”
/dev/sda6: UUID=”1452744c-4c0e-4da5-a30b-39549a44de83″ SEC_TYPE=”ext2″ TYPE=”ext3″

# cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 1044184 0 -1
Error section

These could be found/seen during booting or in dmesg.

Unable to find swap-space signature

activating swap [fail]


_________________
[i]Ubuntu 9.10RC@Dell 710M
/Intel(R) Pentium(R) M processor 1.60GHz
/2048MB Memory/
60G IDE HD
/855GM Integrated Graphics Device
http://blog.chinaunix.net/u3/104343/


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 调整swap分区大小后,可以休眠却不能正常唤醒问题(解决办法)
帖子发表于 : 2009-10-23 8:46 
头像

注册: 2009-03-10 13:04
帖子: 7803
送出感谢: 1
接收感谢: 0 次
记号 :em11


_________________
广告位招租


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 2 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译