{"id":565,"date":"2018-09-16T20:45:49","date_gmt":"2018-09-17T02:45:49","guid":{"rendered":"http:\/\/lucasmanual.com\/blog\/?p=565"},"modified":"2019-12-09T22:27:39","modified_gmt":"2019-12-10T04:27:39","slug":"moving-root-partition-to-nvme-while-keeping-home-on-hdd","status":"publish","type":"post","link":"https:\/\/lucasmanual.com\/blog\/moving-root-partition-to-nvme-while-keeping-home-on-hdd\/","title":{"rendered":"Moving \/ (root partition) to NVME while keeping \/home on HDD"},"content":{"rendered":"<p>I need to move my running Linux Debian machine to my new <a href=\"https:\/\/www.amazon.com\/gp\/product\/B07C8Y31G2\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B07C8Y31G2&amp;linkCode=as2&amp;tag=lucasmanual-20&amp;linkId=cb74f92a8b591c75a80239244b487cca\">m.2 nvme Samsung<\/a> drive to gain 10x IO speed improvement. It&#8217;s crazy fast!<\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>The procedure is very similar as below<\/li>\n<li><a href=\"http:\/\/lucasmanual.com\/blog\/move-root-partition-to-home-partition\/\">http:\/\/lucasmanual.com\/blog\/move-root-partition-to-home-partition\/<\/a><\/li>\n<li><strong>Prerequisites:<\/strong>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>You already installed <a href=\"https:\/\/www.amazon.com\/gp\/product\/B07C8Y31G2\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B07C8Y31G2&amp;linkCode=as2&amp;tag=lucasmanual-20&amp;linkId=cb74f92a8b591c75a80239244b487cca\">NVME<\/a> and partitioned it<\/li>\n<li>You have gpt2 with grub partition similar to :<br \/>\n<code>\/dev\/nvme0n1p1  [       2.00 MiB]<br \/>\n\/dev\/nvme0n1p2  [     550.00 MiB]<br \/>\n\/dev\/nvme0n1p3  [     465.22 GiB]<\/code><\/li>\n<li>You have mount your \/dev\/nvme0n1p3 partition to \/nvme to confirm your current system sees everything and can write to it.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Lets continue:<\/li>\n<li>We mount everything using Debian live as in the <a href=\"http:\/\/lucasmanual.com\/blog\/move-root-partition-to-home-partition\/\">link<\/a><\/li>\n<li>We rsync src and dest (exclude home)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><code>rsync -aAXv --exclude=\/lost+found --exclude=\/root\/trash\/* --exclude=\/var\/tmp\/* <strong>--exclude=\/home\/*<\/strong> \/mnt\/src\/* \/mnt\/dest\/<\/code><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>We continue with instructions on the other page and when its all done lets make sure we upate \/etc\/fstab<\/li>\n<li>We update fstab old partition to new:<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><code># change current \"\/\" to \"\/home\"<br \/>\n#change \"\/nvme\" to \"\/\"<br \/>\n<\/code><\/p>\n<ul>\n<li style=\"list-style-type: none\">\n<ul>\n<li>At this point I would recommend you restart, but note you will only be able to login via a command line. aka CTRL+ALT+F2, because when we reboot the \/home is at \/home\/home and gnome-shell will not like that. We will need to move it, and move everything else to a temporary root_home folder we will create. The reason I&#8217;m recommending reboot is to make sure you have done everything properly. If it boots you are good to now move the old unused files, if it doesn&#8217;t boot, you can still go back to the old system by reverting \/etc\/fstab and try instructions again.<\/li>\n<li><strong>If you confirmed its all good, and only then let&#8217;s do below:<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><code>cd \/home<br \/>\nmkdir root_home<br \/>\nmv \/home\/* \/home\/root_home<br \/>\nmv \/home\/root_home\/home\/* \/home\/<\/code><\/p>\n<ul>\n<li>Lets reboot again and confirm we can log in with gnome-shell.<\/li>\n<li>If yes, we are set. I did move my \/var\/log to \/home\/log in next bonus post.<\/li>\n<li><a href=\"https:\/\/chromium.github.io\/octane\/\">Now lets do our speed test. Octane Score using firefox<\/a> of 43,855<\/li>\n<\/ul>\n<p><strong>Bonus:<\/strong><\/p>\n<ul>\n<li>Move \/var\/log to \/home\/log<\/li>\n<li>To move \/var\/log to \/home\/log we will need to rsync everything then mount it.<code><br \/>\n\/etc\/init.d\/rsyslog stop<br \/>\ncd \/home\/<br \/>\nsudo mkdir log<br \/>\ncd \/var<br \/>\nsudo rsync --remove-source-files -azv \/var\/log\/ \/home\/log<br \/>\n#Note I had to repeat above multiple times because there were other services like apache and mysql<br \/>\n#Now lets edit fstab<br \/>\nsudo vi \/etc\/fstab<br \/>\n#Add a mount point that tells the syste to link \/home\/log as \/var\/log. This way all logs go to hdd,while rest of your system runs on nvme\/ssd.<br \/>\n\/home\/log \/var\/log auto defaults,nofail,nobootwait,bind 0 2 <\/code><\/li>\n<li>Enjoy!<\/li>\n<\/ul>\n<p><iframe style=\"width: 120px; height: 240px;\" src=\"\/\/ws-na.amazon-adsystem.com\/widgets\/q?ServiceVersion=20070822&amp;OneJS=1&amp;Operation=GetAdHtml&amp;MarketPlace=US&amp;source=ac&amp;ref=tf_til&amp;ad_type=product_link&amp;tracking_id=lucasmanual-20&amp;marketplace=amazon&amp;region=US&amp;placement=B07C8Y31G2&amp;asins=B07C8Y31G2&amp;linkId=7aa027937c6eed5480e2caf0168b66f8&amp;show_border=false&amp;link_opens_in_new_window=false&amp;price_color=333333&amp;title_color=0066c0&amp;bg_color=ffffff\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><br \/>\n<\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to move my running Linux Debian machine to my new m.2 nvme Samsung drive to gain 10x IO speed improvement. It&#8217;s crazy fast! The procedure is very similar as below http:\/\/lucasmanual.com\/blog\/move-root-partition-to-home-partition\/ Prerequisites: You already installed NVME and partitioned it You have gpt2 with grub partition similar to : \/dev\/nvme0n1p1 [ 2.00 MiB] \/dev\/nvme0n1p2&hellip; <a class=\"more-link\" href=\"https:\/\/lucasmanual.com\/blog\/moving-root-partition-to-nvme-while-keeping-home-on-hdd\/\">Continue reading <span class=\"screen-reader-text\">Moving \/ (root partition) to NVME while keeping \/home on HDD<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3,4],"tags":[26],"class_list":["post-565","post","type-post","status-publish","format-standard","hentry","category-corporate","category-debian","category-linux","tag-nvme","entry"],"_links":{"self":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/comments?post=565"}],"version-history":[{"count":9,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":606,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/posts\/565\/revisions\/606"}],"wp:attachment":[{"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/media?parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/categories?post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lucasmanual.com\/blog\/wp-json\/wp\/v2\/tags?post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}