{"id":30690,"date":"2019-10-31T21:36:54","date_gmt":"2019-10-31T18:36:54","guid":{"rendered":"https:\/\/prohoster.info\/blog\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak\/"},"modified":"2019-10-31T21:36:54","modified_gmt":"2019-10-31T18:36:54","slug":"spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak","title":{"rendered":"Rescuing a partition in Debian when something goes wrong","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Good afternoon, dear <br \/>\nIt was Thursday evening, and one of our admins needed to resize the disk on one of the KVM virtual machines. Seemingly a trivial task, but it could lead to complete data loss... So... the whole story is under the cut<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nAs I mentioned, on Thursday evening (it didn't seem to be raining) one of our admins decided to address a long-standing task and increase the size of the FS inside the virtual machine <a class=\"wpil_keyword_link\" href=\"https:\/\/prohoster.info\/en\/vps\/abuzoustojchivye-vps\/\"   title=\"KVM\" data-wpil-keyword-link=\"linked\"  data-wpil-monitor-id=\"4366\">KVM<\/a>.<\/p>\n<p>Previously, I had already increased the disk size from 14GB to 60GB, and the admin just needed to expand the FS inside the virtual machine.<\/p>\n<p>Around midnight, the admin sent a message asking whether the partition should be extended or primary... In response, I told him to do it as it had been done before on the virtual machine. <\/p>\n<p>Time passed... and the admin reported that he was encountering errors stating that the partition could not be expanded... and it stopped mounting... it was already 2 AM...<\/p>\n<p>I told him not to do anything further and to leave the virtual machine alone while I went to make a backup of the VM disk image, naming it vmname_bad<\/p>\n<p>It was further complicated by the fact that the admin did not take a snapshot or copy the partition layout before his actions... Having this information would have allowed us to roll back and try again.<\/p>\n<p>In the morning, with fresh thoughts, I booted a virtual machine with the same OS (Debian 9) and connected the disk. Through fdisk, I saw that the disk was already expanded to 60GB and the partition... which was slightly damaged. <\/p>\n<p>I tried to find the previous layout based on the screenshots provided by the admin, but alas, it was in vain. I attempted to figure out values through fdisk, but unfortunately, all attempts failed.<\/p>\n<p>Since fdisk couldn't help me... I called in parted. We loaded parted\u2014I deleted the old partition rm 2 and, knowing the approximate partition values, I did a rescue\u2014specifying the start and end values where the partition could be. After a moment's wait, parted found the partition and offered to put the information into the system\u2014I agreed and exited parted.<\/p>\n<p>I mounted the partition\u2014everything was OK. The files were in place and everything was good, but the size was still the old 14GB. I unmounted \/dev\/sdd1 and ran resize2fs \/dev\/sdd1, then e2fsck \/dev\/sdd1 and mounted it again to see the extended partition with all the files, and it was quite alive. <\/p>\n<p>Everything ended well for both me and the admin.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/446252\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u0432 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 \u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u043e\u0432, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043e\u043a KVM. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u043e\u0431\u0449\u0435\u2026 \u0418 \u0442\u0430\u043a\u2026 \u0432\u0441\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0443\u0436\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u2014 \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u0432 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 (\u0434\u043e\u0436\u0434\u0438\u043a\u0430 \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-30690","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u0432 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 \u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u043e\u0432, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043e\u043a KVM.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0421\u043f\u0430\u0441\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 Debian, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0448\u043b\u043e, \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u0432 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 \u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u043e\u0432, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043e\u043a KVM.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:36:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:36:54+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Restoring a Partition in Debian When Things Go Wrong | ProHoster","description":"Good afternoon, esteemed colleagues. The incident occurred on a Thursday evening, and one of our admins was supposed to resize the disk on one of the KVM virtual machines.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0421\u043f\u0430\u0441\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0432 Debian, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0448\u043b\u043e, \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a | ProHoster","og:description":"\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0447\u0435\u0440\u043e\u043c \u0432 \u0447\u0435\u0442\u0432\u0435\u0440\u0433 \u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0430\u0434\u043c\u0438\u043d\u043e\u0432, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0438\u0441\u043a\u0430 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043e\u043a KVM.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/spasenie-razdela-v-debian-kogda-poshlo-chto-to-ne-tak","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:36:54+00:00","article:modified_time":"2019-10-31T18:36:54+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"30690","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 02:30:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:30:52","updated":"2026-01-21 02:30:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/30690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=30690"}],"version-history":[{"count":1,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/30690\/revisions"}],"predecessor-version":[{"id":164241,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/30690\/revisions\/164241"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=30690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=30690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=30690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}