{"id":131,"date":"2022-04-16T18:13:54","date_gmt":"2022-04-16T09:13:54","guid":{"rendered":"https:\/\/poca.xrea.jp\/?p=131"},"modified":"2023-04-02T10:37:28","modified_gmt":"2023-04-02T01:37:28","slug":"ubuntu-20-04%e3%81%a7%e3%83%8f%e3%82%a4%e3%83%90%e3%83%bc%e3%83%8d%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3","status":"publish","type":"post","link":"https:\/\/poca256.com\/?p=131","title":{"rendered":"ubuntu 20.04\u3067\u30cf\u30a4\u30d0\u30fc\u30cd\u30fc\u30b7\u30e7\u30f3"},"content":{"rendered":"<p>ubuntu\u3092\u30ce\u30fc\u30c8PC\u3067\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u30cf\u30a4\u30d0\u30fc\u30cd\u30fc\u30b7\u30e7\u30f3\uff08\u53e4\u3044\uff1f\uff09\u306b\u76f8\u5f53\u3059\u308b\u6a5f\u80fd\u304c\u898b\u305f\u3042\u308a\u307e\u305b\u3093\u3002\u307b\u307cAC\u96fb\u6e90\u306b\u3064\u306a\u3052\u3066\u4f7f\u3063\u3066\u306f\u3044\u307e\u3059\u304c\u3001\u30b9\u30bf\u30f3\u30d0\u30a4\u3060\u3051\u3060\u3068\u30d0\u30c3\u30c6\u30ea\u304c\u5207\u308c\u305f\u3068\u304d\u306b\u843d\u3061\u3066\u3057\u307e\u3046\u306e\u3067\u306f\u30fb\u30fb\u30fb\u3002\u3068\u3044\u3046\u308f\u3051\u3067\u30cf\u30a4\u30d0\u30cd\u30fc\u30b7\u30e7\u30f3\u3092\u6709\u52b9\u306b\u3059\u308b\u4f5c\u696d\u3092\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/gihyo.jp\/admin\/serial\/01\/ubuntu-recipe\/0637?page=2\">https:\/\/gihyo.jp\/admin\/serial\/01\/ubuntu-recipe\/0637?page=2<\/a><\/p>\n<p><a href=\"https:\/\/askubuntu.com\/questions\/1240123\/how-to-enable-the-hibernate-option-in-ubuntu-20-04\">https:\/\/askubuntu.com\/questions\/1240123\/how-to-enable-the-hibernate-option-in-ubuntu-20-04<\/a><br \/>\n\u78ba\u8a8d<\/p>\n<div class=\"oceanwp-oembed-wrap clr\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"3DDUOBrIjW\"><p><a href=\"https:\/\/www.lorenzobettini.it\/2020\/07\/enabling-hibernation-on-ubuntu-20-04\/\">Enabling Hibernation on Ubuntu 20.04<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Enabling Hibernation on Ubuntu 20.04&#8221; &#8212; Lorenzo Bettini\" src=\"https:\/\/www.lorenzobettini.it\/2020\/07\/enabling-hibernation-on-ubuntu-20-04\/embed\/#?secret=A5GFD4jY2Q#?secret=3DDUOBrIjW\" data-secret=\"3DDUOBrIjW\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/div>\n<p>&nbsp;<\/p>\n<p>\u30cf\u30a4\u30d0\u30cd\u30fc\u30b7\u30e7\u30f3\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u305f\u3081\u306b\u306f\u3001kernel\u306e\u8d77\u52d5\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306bswap\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u30b9\u30ef\u30c3\u30d7\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306eUUID\u6307\u5b9a\u3059\u308b<\/li>\n<li>\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3059\u308b<\/li>\n<li>\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306eUUID\u3092\u6307\u5b9a\u3059\u308b<\/li>\n<li>\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u3059\u308b\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306eUUID\u3068\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u3092\u6307\u5b9a\u3059\u308b<\/li>\n<\/ol>\n<p>\u3069\u308c\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u304b\u306f\u74b0\u5883\u306b\u4f9d\u5b58\u3059\u308b\u3088\u3046\u3067\u3059\u3002\u79c1\u306e\u74b0\u5883\u3067\/etc\/fstab\u30d5\u30a1\u30a4\u30eb\u3092\u8997\u3044\u3066\u3082\u30b9\u30ef\u30c3\u30d7\u30d1\u30c6\u30a3\u30b7\u30e7\u30f3\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\uff12\uff0c\uff13\uff0c\uff14\u3092\u3044\u308d\u3044\u308d\u305f\u3081\u3057\u305f\u3068\u3053\u308d\u30014\u306b\u3066\u3046\u307e\u304f\u884c\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u518d\u4f5c\u6210<\/h3>\n<blockquote>\n<pre><samp>$ sudo swapoff -a\r\n$ sudo fallocate -l 8g \/swapfile\r\n$ sudo chmod 600 \/swapfile\r\n$ sudo mkswap \/swapfile<\/samp><\/pre>\n<\/blockquote>\n<p>swap-offset swap-offset swap-offset<br \/>\n(8GB\u306e\u30b9\u30ef\u30c3\u30d7\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\uff09<\/p>\n<h3>kernel\u8d77\u52d5\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8abf\u67fb<\/h3>\n<blockquote>\n<pre>$findmnt -no UUID -T \/swapfile &amp;&amp; sudo swap-offset \/swapfile\r\n03430175-b7a6-4847-b678-c6413e36e2ae\r\nresume offset = 57939968\r\n(swap-offset\u304c\u4f7f\u3048\u306a\u3044\u5834\u5408\u306eresume\u306e\u78ba\u8a8d)\r\n$sudo filefrag -v \/swapfile |grep \" 0:\"| awk '{print $4}'\r\n34816..\r\n<\/pre>\n<\/blockquote>\n<h3>kernel\u8d77\u52d5\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u4fee\u6b63<\/h3>\n<blockquote>\n<pre>$sudo vi \/etc\/default\/grub<\/pre>\n<\/blockquote>\n<pre class=\"lang-none s-code-block\"><code>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"<\/code><\/pre>\n<p>\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63<\/p>\n<pre class=\"lang-none s-code-block\"><code>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash resume=UUID=371b1a95-d91b-49f8-aa4a-da51cbf780b2 resume_offset=23888916\"<\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001grub\u306e\u8d77\u52d5\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3057\u3066\u304b\u3089\u4e00\u5ea6\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>&amp;sudo update-grub<\/pre>\n<\/blockquote>\n<h3 class=\"lang-none s-code-block\"><code><\/code>hibernate\u306e\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<blockquote>\n<pre>$sudo systemctl hibernate<\/pre>\n<\/blockquote>\n<p>\u30cf\u30a4\u30d0\u30cd\u30fc\u30b7\u30e7\u30f3\u3057\u3066PC\u306e\u96fb\u6e90\u304c\u5207\u308c\u307e\u3059\u3002<br \/>\n\u305d\u306e\u5f8c\u96fb\u6e90\u3092\u3044\u308c\u3066kernel\u8d77\u52d5\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304c\u3046\u307e\u304f\u53cd\u6620\u3055\u308c\u308c\u3070\u3001\u4f5c\u696d\u74b0\u5883\u304c\u5143\u901a\u308a\u306b\u306a\u308a\u307e\u3059\u3002\u79c1\u306f\u4e0a\u8a18\uff12\uff0c\uff13\uff0c\uff14\u3092\u3044\u308d\u3044\u308d\u8a66\u3057\u307e\u3057\u305f\u304c\u3002<\/p>\n<p>&#8212;<br \/>\n(2023\/3\/30\u8ffd\u8a18\uff09<br \/>\n\u3053\u308c\u3088\u308a\u4ee5\u4e0b\u306e\u64cd\u4f5c\u306f\u65b9\u6cd5\u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>https:\/\/github.com\/systemd\/systemd\/issues\/25269<\/p>\n<p>> Looks like you are messing manually with your systemd there thinking<br \/>\n> I wouldn&#8217;t suggest messing like that before you absolutely know what your&#8217;re doing&#8230;<\/p>\n<p>Ubuntu 22.04\u3092\u518d\u69cb\u7bc9\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u306e\u3067\u305d\u3053\u3067\u52d5\u4f5c\u3092\u898b\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059<\/p>\n<p>(\u8ffd\u8a18\u3053\u3053\u307e\u3067\uff09<br \/>\n&#8212;<\/p>\n<h3>\u30b9\u30ea\u30fc\u30d7\u5f8c\u4e00\u5b9a\u6642\u9593\u3067\u30d0\u30a4\u30d0\u30cd\u30fc\u30b7\u30e7\u30f3\u306b\u79fb\u884c<\/h3>\n<p>swap-offset<br \/>\n\u6bce\u56de\u30cf\u30a4\u30d0\u30cd\u30fc\u30b7\u30e7\u30f3\u3092\u3055\u305b\u308b\u3068\u8d77\u52d5\u307e\u3067\u306b\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3057\u3001SSD\u306e\u5bff\u547d\u3092\u7e2e\u3081\u3066\u3057\u307e\u3044\u307e\u3059\u3002suspend-then-hibernate\u3068\u3044\u3046\u4ed5\u7d44\u307f\u3092\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>$sudo vi \/etc\/systemd\/sleep.conf<\/pre>\n<\/blockquote>\n<p>#HibernateDelaySec=180min\u306e\u90e8\u5206\u3092\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3057\u3066\u9069\u5f53\u306a\u6642\u9593\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>sudo ln -s \/usr\/lib\/systemd\/system\/systemd-suspend-then-hibernate.service \\\r\n\/etc\/systemd\/system\/systemd-suspend.service<\/pre>\n<\/blockquote>\n<p>\u3042\u3068\u306f\u30b9\u30ea\u30fc\u30d7\u306e\u52d5\u4f5c\u3092suspend-then-hibernate\u306e\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3067Windows\u30ce\u30fc\u30c8PC\u3068\u6bd4\u8f03\u3057\u3066\u3082\u9055\u548c\u611f\u306a\u304f\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ubuntu\u3092\u30ce\u30fc\u30c8PC\u3067\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u30cf\u30a4\u30d0\u30fc\u30cd\u30fc\u30b7\u30e7\u30f3\uff08\u53e4\u3044\uff1f\uff09\u306b\u76f8\u5f53\u3059\u308b\u6a5f\u80fd\u304c\u898b\u305f\u3042\u308a\u307e\u305b\u3093\u3002\u307b\u307cAC\u96fb\u6e90\u306b\u3064\u306a\u3052\u3066\u4f7f\u3063\u3066\u306f\u3044\u307e\u3059\u304c\u3001\u30b9\u30bf\u30f3\u30d0\u30a4\u3060\u3051\u3060\u3068\u30d0\u30c3\u30c6\u30ea\u304c\u5207\u308c\u305f\u3068\u304d\u306b\u843d\u3061\u3066\u3057\u307e\u3046\u306e\u3067\u306f\u30fb\u30fb\u30fb\u3002\u3068\u3044\u3046\u308f\u3051 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[5],"tags":[],"class_list":["post-131","post","type-post","status-publish","format-standard","hentry","category-linux","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/poca256.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131"}],"version-history":[{"count":16,"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/poca256.com\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions\/329"}],"wp:attachment":[{"href":"https:\/\/poca256.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poca256.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poca256.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}