index.html 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787
  1. <!DOCTYPE html>
  2. <html lang="en-us">
  3. <head>
  4. <title>
  5. Move /home Folder | codeskraps
  6. </title>
  7. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <meta name="description" content="Mobile development blog by Carles Sentis, sharing expertise in Android, iOS, and Kotlin Multiplatform development">
  10. <meta name="generator" content="Hugo 0.145.0">
  11. <link rel="canonical" href="https://codeskraps.com/posts/2025/move_home_folder/" >
  12. <link href="/css/style.min.ef8e99489b0b85e34523800e588426b1b4c05e27adcb9d7193952cef205afe6d.css" rel="stylesheet">
  13. </head>
  14. <body>
  15. <div class="flexWrapper">
  16. <header class="headerWrapper">
  17. <div class="header">
  18. <div>
  19. <a class="terminal" href="https://codeskraps.com/">
  20. <span>me@codeskraps.com ~ $</span>
  21. </a>
  22. </div>
  23. <input class="side-menu" type="checkbox" id="side-menu">
  24. <label class="hamb" for="side-menu"><span class="hamb-line"></span></label>
  25. <nav class="headerLinks">
  26. <ul>
  27. <li>
  28. <a href="https://codeskraps.com/posts/" title="" >
  29. ~/posts</a>
  30. </li>
  31. <li>
  32. <a href="https://codeskraps.com/projects/" title="" >
  33. ~/projects</a>
  34. </li>
  35. <li>
  36. <a href="https://codeskraps.com/about/" title="" >
  37. ~/about</a>
  38. </li>
  39. </ul>
  40. </nav>
  41. </divi>
  42. <script async src="https://www.googletagmanager.com/gtag/js?id=G-YP8WK3KZF1"></script>
  43. <script>
  44. var doNotTrack = false;
  45. if ( false ) {
  46. var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
  47. var doNotTrack = (dnt == "1" || dnt == "yes");
  48. }
  49. if (!doNotTrack) {
  50. window.dataLayer = window.dataLayer || [];
  51. function gtag(){dataLayer.push(arguments);}
  52. gtag('js', new Date());
  53. gtag('config', 'G-YP8WK3KZF1');
  54. }
  55. </script>
  56. </header>
  57. <div class="content">
  58. <main class="main">
  59. <div class="postWrapper">
  60. <h1>Move /home Folder</h1>
  61. <section class="postMetadata">
  62. <dl>
  63. <dt>tags</dt>
  64. <dd><span></span>
  65. <a href="/tags/linux/">#Linux</a></dd>
  66. <dt>published</dt>
  67. <dd><time datetime="2025-01-29">January 29, 2025</time></dd>
  68. <dt>reading time</dt>
  69. <dd>2 minutes</dd>
  70. </dl>
  71. </section>
  72. <div>
  73. <p>You can move the <code>/home</code> folder on Ubuntu, but you must do it carefully to avoid breaking your system. Below are the steps to safely move <code>/home</code> to a new location.</p>
  74. <hr>
  75. <h2 id="1-create-a-backup-recommended"><strong>1. Create a Backup (Recommended)</strong></h2>
  76. <p>Before proceeding, create a backup of your home folder in case anything goes wrong.</p>
  77. <style>
  78. .code-block-container {
  79. position: relative;
  80. margin: 1em 0;
  81. border: 1px solid #5E5E5E;
  82. border-radius: 1px;
  83. overflow: hidden;
  84. }
  85. .code-header {
  86. position: absolute;
  87. top: 8px;
  88. right: 8px;
  89. z-index: 999;
  90. }
  91. .copy-button {
  92. display: inline-flex;
  93. align-items: center;
  94. background: #2d2d2d;
  95. color: white;
  96. border: 1px solid #404040;
  97. border-radius: 4px;
  98. padding: 4px 8px;
  99. font-size: 0.8em;
  100. cursor: pointer;
  101. transition: all 0.2s ease;
  102. }
  103. .copy-button:hover {
  104. background: #404040;
  105. }
  106. .copy-button svg {
  107. width: 14px;
  108. height: 14px;
  109. margin-right: 4px;
  110. }
  111. .tooltip {
  112. position: absolute;
  113. top: -30px;
  114. left: 50%;
  115. transform: translateX(-50%);
  116. background: black;
  117. color: white;
  118. padding: 4px 8px;
  119. border-radius: 4px;
  120. font-size: 12px;
  121. display: none;
  122. }
  123. .tooltip::after {
  124. content: "";
  125. position: absolute;
  126. top: 100%;
  127. left: 50%;
  128. transform: translateX(-50%);
  129. border: 5px solid transparent;
  130. border-top-color: black;
  131. }
  132. .copy-button.copied .tooltip {
  133. display: block;
  134. }
  135. .code-content {
  136. margin: 0;
  137. padding: 0;
  138. }
  139. .code-content pre {
  140. margin: 0;
  141. padding: 10px;
  142. }
  143. </style>
  144. <div class="code-block-container" data-lang="bash">
  145. <div class="code-header">
  146. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  147. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  148. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  149. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  150. </svg>
  151. <span>Copy</span>
  152. <div class="tooltip">Copied!</div>
  153. </button>
  154. </div>
  155. <div class="code-content">
  156. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo tar -czvf /home_backup.tar.gz /home</span></span></code></pre></div>
  157. </div>
  158. </div>
  159. <script>
  160. function copyCodeBlock(button) {
  161. const container = button.closest('.code-block-container');
  162. const codeContent = container.querySelector('.code-content pre');
  163. const code = codeContent.textContent;
  164. navigator.clipboard.writeText(code.trim()).then(() => {
  165. button.classList.add('copied');
  166. setTimeout(() => {
  167. button.classList.remove('copied');
  168. }, 2000);
  169. }).catch(err => {
  170. console.error('Failed to copy:', err);
  171. const textarea = document.createElement('textarea');
  172. textarea.value = code.trim();
  173. document.body.appendChild(textarea);
  174. textarea.select();
  175. try {
  176. document.execCommand('copy');
  177. button.classList.add('copied');
  178. setTimeout(() => {
  179. button.classList.remove('copied');
  180. }, 2000);
  181. } catch (e) {
  182. console.error('Fallback failed:', e);
  183. }
  184. document.body.removeChild(textarea);
  185. });
  186. }
  187. </script>
  188. <h2 id="2-create-a-new-partition-or-mount-point-if-needed"><strong>2. Create a New Partition or Mount Point (If Needed)</strong></h2>
  189. <p>If you&rsquo;re moving /home to a different partition or disk, make sure it&rsquo;s properly formatted and mounted.</p>
  190. <p>For example, if you want to use a new disk (e.g., <code>/dev/sdb1</code>):</p>
  191. <style>
  192. .code-block-container {
  193. position: relative;
  194. margin: 1em 0;
  195. border: 1px solid #5E5E5E;
  196. border-radius: 1px;
  197. overflow: hidden;
  198. }
  199. .code-header {
  200. position: absolute;
  201. top: 8px;
  202. right: 8px;
  203. z-index: 999;
  204. }
  205. .copy-button {
  206. display: inline-flex;
  207. align-items: center;
  208. background: #2d2d2d;
  209. color: white;
  210. border: 1px solid #404040;
  211. border-radius: 4px;
  212. padding: 4px 8px;
  213. font-size: 0.8em;
  214. cursor: pointer;
  215. transition: all 0.2s ease;
  216. }
  217. .copy-button:hover {
  218. background: #404040;
  219. }
  220. .copy-button svg {
  221. width: 14px;
  222. height: 14px;
  223. margin-right: 4px;
  224. }
  225. .tooltip {
  226. position: absolute;
  227. top: -30px;
  228. left: 50%;
  229. transform: translateX(-50%);
  230. background: black;
  231. color: white;
  232. padding: 4px 8px;
  233. border-radius: 4px;
  234. font-size: 12px;
  235. display: none;
  236. }
  237. .tooltip::after {
  238. content: "";
  239. position: absolute;
  240. top: 100%;
  241. left: 50%;
  242. transform: translateX(-50%);
  243. border: 5px solid transparent;
  244. border-top-color: black;
  245. }
  246. .copy-button.copied .tooltip {
  247. display: block;
  248. }
  249. .code-content {
  250. margin: 0;
  251. padding: 0;
  252. }
  253. .code-content pre {
  254. margin: 0;
  255. padding: 10px;
  256. }
  257. </style>
  258. <div class="code-block-container" data-lang="bash">
  259. <div class="code-header">
  260. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  261. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  262. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  263. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  264. </svg>
  265. <span>Copy</span>
  266. <div class="tooltip">Copied!</div>
  267. </button>
  268. </div>
  269. <div class="code-content">
  270. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo mkfs.ext4 /dev/sdb1
  271. </span></span><span style="display:flex;"><span>sudo mkdir /mnt/newhome
  272. </span></span><span style="display:flex;"><span>sudo mount /dev/sdb1 /mnt/newhome</span></span></code></pre></div>
  273. </div>
  274. </div>
  275. <script>
  276. function copyCodeBlock(button) {
  277. const container = button.closest('.code-block-container');
  278. const codeContent = container.querySelector('.code-content pre');
  279. const code = codeContent.textContent;
  280. navigator.clipboard.writeText(code.trim()).then(() => {
  281. button.classList.add('copied');
  282. setTimeout(() => {
  283. button.classList.remove('copied');
  284. }, 2000);
  285. }).catch(err => {
  286. console.error('Failed to copy:', err);
  287. const textarea = document.createElement('textarea');
  288. textarea.value = code.trim();
  289. document.body.appendChild(textarea);
  290. textarea.select();
  291. try {
  292. document.execCommand('copy');
  293. button.classList.add('copied');
  294. setTimeout(() => {
  295. button.classList.remove('copied');
  296. }, 2000);
  297. } catch (e) {
  298. console.error('Fallback failed:', e);
  299. }
  300. document.body.removeChild(textarea);
  301. });
  302. }
  303. </script>
  304. <h2 id="3-copy-the-home-folder"><strong>3. Copy the Home Folder</strong></h2>
  305. <p>Copy all user data to the new location while preserving permissions:</p>
  306. <style>
  307. .code-block-container {
  308. position: relative;
  309. margin: 1em 0;
  310. border: 1px solid #5E5E5E;
  311. border-radius: 1px;
  312. overflow: hidden;
  313. }
  314. .code-header {
  315. position: absolute;
  316. top: 8px;
  317. right: 8px;
  318. z-index: 999;
  319. }
  320. .copy-button {
  321. display: inline-flex;
  322. align-items: center;
  323. background: #2d2d2d;
  324. color: white;
  325. border: 1px solid #404040;
  326. border-radius: 4px;
  327. padding: 4px 8px;
  328. font-size: 0.8em;
  329. cursor: pointer;
  330. transition: all 0.2s ease;
  331. }
  332. .copy-button:hover {
  333. background: #404040;
  334. }
  335. .copy-button svg {
  336. width: 14px;
  337. height: 14px;
  338. margin-right: 4px;
  339. }
  340. .tooltip {
  341. position: absolute;
  342. top: -30px;
  343. left: 50%;
  344. transform: translateX(-50%);
  345. background: black;
  346. color: white;
  347. padding: 4px 8px;
  348. border-radius: 4px;
  349. font-size: 12px;
  350. display: none;
  351. }
  352. .tooltip::after {
  353. content: "";
  354. position: absolute;
  355. top: 100%;
  356. left: 50%;
  357. transform: translateX(-50%);
  358. border: 5px solid transparent;
  359. border-top-color: black;
  360. }
  361. .copy-button.copied .tooltip {
  362. display: block;
  363. }
  364. .code-content {
  365. margin: 0;
  366. padding: 0;
  367. }
  368. .code-content pre {
  369. margin: 0;
  370. padding: 10px;
  371. }
  372. </style>
  373. <div class="code-block-container" data-lang="bash">
  374. <div class="code-header">
  375. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  376. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  377. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  378. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  379. </svg>
  380. <span>Copy</span>
  381. <div class="tooltip">Copied!</div>
  382. </button>
  383. </div>
  384. <div class="code-content">
  385. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo rsync -aXS /home/ /mnt/newhome/</span></span></code></pre></div>
  386. </div>
  387. </div>
  388. <script>
  389. function copyCodeBlock(button) {
  390. const container = button.closest('.code-block-container');
  391. const codeContent = container.querySelector('.code-content pre');
  392. const code = codeContent.textContent;
  393. navigator.clipboard.writeText(code.trim()).then(() => {
  394. button.classList.add('copied');
  395. setTimeout(() => {
  396. button.classList.remove('copied');
  397. }, 2000);
  398. }).catch(err => {
  399. console.error('Failed to copy:', err);
  400. const textarea = document.createElement('textarea');
  401. textarea.value = code.trim();
  402. document.body.appendChild(textarea);
  403. textarea.select();
  404. try {
  405. document.execCommand('copy');
  406. button.classList.add('copied');
  407. setTimeout(() => {
  408. button.classList.remove('copied');
  409. }, 2000);
  410. } catch (e) {
  411. console.error('Fallback failed:', e);
  412. }
  413. document.body.removeChild(textarea);
  414. });
  415. }
  416. </script>
  417. <hr>
  418. <h2 id="4-update-fstab"><strong>4. Update fstab</strong></h2>
  419. <p>Edit /etc/fstab to mount the new home directory at boot.</p>
  420. <style>
  421. .code-block-container {
  422. position: relative;
  423. margin: 1em 0;
  424. border: 1px solid #5E5E5E;
  425. border-radius: 1px;
  426. overflow: hidden;
  427. }
  428. .code-header {
  429. position: absolute;
  430. top: 8px;
  431. right: 8px;
  432. z-index: 999;
  433. }
  434. .copy-button {
  435. display: inline-flex;
  436. align-items: center;
  437. background: #2d2d2d;
  438. color: white;
  439. border: 1px solid #404040;
  440. border-radius: 4px;
  441. padding: 4px 8px;
  442. font-size: 0.8em;
  443. cursor: pointer;
  444. transition: all 0.2s ease;
  445. }
  446. .copy-button:hover {
  447. background: #404040;
  448. }
  449. .copy-button svg {
  450. width: 14px;
  451. height: 14px;
  452. margin-right: 4px;
  453. }
  454. .tooltip {
  455. position: absolute;
  456. top: -30px;
  457. left: 50%;
  458. transform: translateX(-50%);
  459. background: black;
  460. color: white;
  461. padding: 4px 8px;
  462. border-radius: 4px;
  463. font-size: 12px;
  464. display: none;
  465. }
  466. .tooltip::after {
  467. content: "";
  468. position: absolute;
  469. top: 100%;
  470. left: 50%;
  471. transform: translateX(-50%);
  472. border: 5px solid transparent;
  473. border-top-color: black;
  474. }
  475. .copy-button.copied .tooltip {
  476. display: block;
  477. }
  478. .code-content {
  479. margin: 0;
  480. padding: 0;
  481. }
  482. .code-content pre {
  483. margin: 0;
  484. padding: 10px;
  485. }
  486. </style>
  487. <div class="code-block-container" data-lang="bash">
  488. <div class="code-header">
  489. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  490. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  491. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  492. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  493. </svg>
  494. <span>Copy</span>
  495. <div class="tooltip">Copied!</div>
  496. </button>
  497. </div>
  498. <div class="code-content">
  499. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo nano /etc/fstab</span></span></code></pre></div>
  500. </div>
  501. </div>
  502. <script>
  503. function copyCodeBlock(button) {
  504. const container = button.closest('.code-block-container');
  505. const codeContent = container.querySelector('.code-content pre');
  506. const code = codeContent.textContent;
  507. navigator.clipboard.writeText(code.trim()).then(() => {
  508. button.classList.add('copied');
  509. setTimeout(() => {
  510. button.classList.remove('copied');
  511. }, 2000);
  512. }).catch(err => {
  513. console.error('Failed to copy:', err);
  514. const textarea = document.createElement('textarea');
  515. textarea.value = code.trim();
  516. document.body.appendChild(textarea);
  517. textarea.select();
  518. try {
  519. document.execCommand('copy');
  520. button.classList.add('copied');
  521. setTimeout(() => {
  522. button.classList.remove('copied');
  523. }, 2000);
  524. } catch (e) {
  525. console.error('Fallback failed:', e);
  526. }
  527. document.body.removeChild(textarea);
  528. });
  529. }
  530. </script>
  531. <p>Add this line at the end (adjust the path accordingly):</p>
  532. <style>
  533. .code-block-container {
  534. position: relative;
  535. margin: 1em 0;
  536. border: 1px solid #5E5E5E;
  537. border-radius: 1px;
  538. overflow: hidden;
  539. }
  540. .code-header {
  541. position: absolute;
  542. top: 8px;
  543. right: 8px;
  544. z-index: 999;
  545. }
  546. .copy-button {
  547. display: inline-flex;
  548. align-items: center;
  549. background: #2d2d2d;
  550. color: white;
  551. border: 1px solid #404040;
  552. border-radius: 4px;
  553. padding: 4px 8px;
  554. font-size: 0.8em;
  555. cursor: pointer;
  556. transition: all 0.2s ease;
  557. }
  558. .copy-button:hover {
  559. background: #404040;
  560. }
  561. .copy-button svg {
  562. width: 14px;
  563. height: 14px;
  564. margin-right: 4px;
  565. }
  566. .tooltip {
  567. position: absolute;
  568. top: -30px;
  569. left: 50%;
  570. transform: translateX(-50%);
  571. background: black;
  572. color: white;
  573. padding: 4px 8px;
  574. border-radius: 4px;
  575. font-size: 12px;
  576. display: none;
  577. }
  578. .tooltip::after {
  579. content: "";
  580. position: absolute;
  581. top: 100%;
  582. left: 50%;
  583. transform: translateX(-50%);
  584. border: 5px solid transparent;
  585. border-top-color: black;
  586. }
  587. .copy-button.copied .tooltip {
  588. display: block;
  589. }
  590. .code-content {
  591. margin: 0;
  592. padding: 0;
  593. }
  594. .code-content pre {
  595. margin: 0;
  596. padding: 10px;
  597. }
  598. </style>
  599. <div class="code-block-container" data-lang="bash">
  600. <div class="code-header">
  601. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  602. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  603. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  604. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  605. </svg>
  606. <span>Copy</span>
  607. <div class="tooltip">Copied!</div>
  608. </button>
  609. </div>
  610. <div class="code-content">
  611. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>/dev/sdb1 /home ext4 defaults <span style="color:#bd93f9">0</span> <span style="color:#bd93f9">2</span></span></span></code></pre></div>
  612. </div>
  613. </div>
  614. <script>
  615. function copyCodeBlock(button) {
  616. const container = button.closest('.code-block-container');
  617. const codeContent = container.querySelector('.code-content pre');
  618. const code = codeContent.textContent;
  619. navigator.clipboard.writeText(code.trim()).then(() => {
  620. button.classList.add('copied');
  621. setTimeout(() => {
  622. button.classList.remove('copied');
  623. }, 2000);
  624. }).catch(err => {
  625. console.error('Failed to copy:', err);
  626. const textarea = document.createElement('textarea');
  627. textarea.value = code.trim();
  628. document.body.appendChild(textarea);
  629. textarea.select();
  630. try {
  631. document.execCommand('copy');
  632. button.classList.add('copied');
  633. setTimeout(() => {
  634. button.classList.remove('copied');
  635. }, 2000);
  636. } catch (e) {
  637. console.error('Fallback failed:', e);
  638. }
  639. document.body.removeChild(textarea);
  640. });
  641. }
  642. </script>
  643. <p>If you prefer using the UUID, first find it:</p>
  644. <style>
  645. .code-block-container {
  646. position: relative;
  647. margin: 1em 0;
  648. border: 1px solid #5E5E5E;
  649. border-radius: 1px;
  650. overflow: hidden;
  651. }
  652. .code-header {
  653. position: absolute;
  654. top: 8px;
  655. right: 8px;
  656. z-index: 999;
  657. }
  658. .copy-button {
  659. display: inline-flex;
  660. align-items: center;
  661. background: #2d2d2d;
  662. color: white;
  663. border: 1px solid #404040;
  664. border-radius: 4px;
  665. padding: 4px 8px;
  666. font-size: 0.8em;
  667. cursor: pointer;
  668. transition: all 0.2s ease;
  669. }
  670. .copy-button:hover {
  671. background: #404040;
  672. }
  673. .copy-button svg {
  674. width: 14px;
  675. height: 14px;
  676. margin-right: 4px;
  677. }
  678. .tooltip {
  679. position: absolute;
  680. top: -30px;
  681. left: 50%;
  682. transform: translateX(-50%);
  683. background: black;
  684. color: white;
  685. padding: 4px 8px;
  686. border-radius: 4px;
  687. font-size: 12px;
  688. display: none;
  689. }
  690. .tooltip::after {
  691. content: "";
  692. position: absolute;
  693. top: 100%;
  694. left: 50%;
  695. transform: translateX(-50%);
  696. border: 5px solid transparent;
  697. border-top-color: black;
  698. }
  699. .copy-button.copied .tooltip {
  700. display: block;
  701. }
  702. .code-content {
  703. margin: 0;
  704. padding: 0;
  705. }
  706. .code-content pre {
  707. margin: 0;
  708. padding: 10px;
  709. }
  710. </style>
  711. <div class="code-block-container" data-lang="bash">
  712. <div class="code-header">
  713. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  714. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  715. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  716. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  717. </svg>
  718. <span>Copy</span>
  719. <div class="tooltip">Copied!</div>
  720. </button>
  721. </div>
  722. <div class="code-content">
  723. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo blkid</span></span></code></pre></div>
  724. </div>
  725. </div>
  726. <script>
  727. function copyCodeBlock(button) {
  728. const container = button.closest('.code-block-container');
  729. const codeContent = container.querySelector('.code-content pre');
  730. const code = codeContent.textContent;
  731. navigator.clipboard.writeText(code.trim()).then(() => {
  732. button.classList.add('copied');
  733. setTimeout(() => {
  734. button.classList.remove('copied');
  735. }, 2000);
  736. }).catch(err => {
  737. console.error('Failed to copy:', err);
  738. const textarea = document.createElement('textarea');
  739. textarea.value = code.trim();
  740. document.body.appendChild(textarea);
  741. textarea.select();
  742. try {
  743. document.execCommand('copy');
  744. button.classList.add('copied');
  745. setTimeout(() => {
  746. button.classList.remove('copied');
  747. }, 2000);
  748. } catch (e) {
  749. console.error('Fallback failed:', e);
  750. }
  751. document.body.removeChild(textarea);
  752. });
  753. }
  754. </script>
  755. <p>Then, add this line instead:</p>
  756. <style>
  757. .code-block-container {
  758. position: relative;
  759. margin: 1em 0;
  760. border: 1px solid #5E5E5E;
  761. border-radius: 1px;
  762. overflow: hidden;
  763. }
  764. .code-header {
  765. position: absolute;
  766. top: 8px;
  767. right: 8px;
  768. z-index: 999;
  769. }
  770. .copy-button {
  771. display: inline-flex;
  772. align-items: center;
  773. background: #2d2d2d;
  774. color: white;
  775. border: 1px solid #404040;
  776. border-radius: 4px;
  777. padding: 4px 8px;
  778. font-size: 0.8em;
  779. cursor: pointer;
  780. transition: all 0.2s ease;
  781. }
  782. .copy-button:hover {
  783. background: #404040;
  784. }
  785. .copy-button svg {
  786. width: 14px;
  787. height: 14px;
  788. margin-right: 4px;
  789. }
  790. .tooltip {
  791. position: absolute;
  792. top: -30px;
  793. left: 50%;
  794. transform: translateX(-50%);
  795. background: black;
  796. color: white;
  797. padding: 4px 8px;
  798. border-radius: 4px;
  799. font-size: 12px;
  800. display: none;
  801. }
  802. .tooltip::after {
  803. content: "";
  804. position: absolute;
  805. top: 100%;
  806. left: 50%;
  807. transform: translateX(-50%);
  808. border: 5px solid transparent;
  809. border-top-color: black;
  810. }
  811. .copy-button.copied .tooltip {
  812. display: block;
  813. }
  814. .code-content {
  815. margin: 0;
  816. padding: 0;
  817. }
  818. .code-content pre {
  819. margin: 0;
  820. padding: 10px;
  821. }
  822. </style>
  823. <div class="code-block-container" data-lang="arduino">
  824. <div class="code-header">
  825. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  826. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  827. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  828. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  829. </svg>
  830. <span>Copy</span>
  831. <div class="tooltip">Copied!</div>
  832. </button>
  833. </div>
  834. <div class="code-content">
  835. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-arduino" data-lang="arduino"><span style="display:flex;"><span>UUID<span style="color:#ff79c6">=</span>your<span style="color:#ff79c6">-</span>uuid <span style="color:#ff79c6">/</span><span style="color:#50fa7b">home</span> ext4 defaults <span style="color:#bd93f9">0</span> <span style="color:#bd93f9">2</span></span></span></code></pre></div>
  836. </div>
  837. </div>
  838. <script>
  839. function copyCodeBlock(button) {
  840. const container = button.closest('.code-block-container');
  841. const codeContent = container.querySelector('.code-content pre');
  842. const code = codeContent.textContent;
  843. navigator.clipboard.writeText(code.trim()).then(() => {
  844. button.classList.add('copied');
  845. setTimeout(() => {
  846. button.classList.remove('copied');
  847. }, 2000);
  848. }).catch(err => {
  849. console.error('Failed to copy:', err);
  850. const textarea = document.createElement('textarea');
  851. textarea.value = code.trim();
  852. document.body.appendChild(textarea);
  853. textarea.select();
  854. try {
  855. document.execCommand('copy');
  856. button.classList.add('copied');
  857. setTimeout(() => {
  858. button.classList.remove('copied');
  859. }, 2000);
  860. } catch (e) {
  861. console.error('Fallback failed:', e);
  862. }
  863. document.body.removeChild(textarea);
  864. });
  865. }
  866. </script>
  867. <hr>
  868. <h2 id="5-unmount-old-home-and-mount-new-one"><strong>5. Unmount Old Home and Mount New One</strong></h2>
  869. <p>Switch to a different session (e.g., TTY):</p>
  870. <style>
  871. .code-block-container {
  872. position: relative;
  873. margin: 1em 0;
  874. border: 1px solid #5E5E5E;
  875. border-radius: 1px;
  876. overflow: hidden;
  877. }
  878. .code-header {
  879. position: absolute;
  880. top: 8px;
  881. right: 8px;
  882. z-index: 999;
  883. }
  884. .copy-button {
  885. display: inline-flex;
  886. align-items: center;
  887. background: #2d2d2d;
  888. color: white;
  889. border: 1px solid #404040;
  890. border-radius: 4px;
  891. padding: 4px 8px;
  892. font-size: 0.8em;
  893. cursor: pointer;
  894. transition: all 0.2s ease;
  895. }
  896. .copy-button:hover {
  897. background: #404040;
  898. }
  899. .copy-button svg {
  900. width: 14px;
  901. height: 14px;
  902. margin-right: 4px;
  903. }
  904. .tooltip {
  905. position: absolute;
  906. top: -30px;
  907. left: 50%;
  908. transform: translateX(-50%);
  909. background: black;
  910. color: white;
  911. padding: 4px 8px;
  912. border-radius: 4px;
  913. font-size: 12px;
  914. display: none;
  915. }
  916. .tooltip::after {
  917. content: "";
  918. position: absolute;
  919. top: 100%;
  920. left: 50%;
  921. transform: translateX(-50%);
  922. border: 5px solid transparent;
  923. border-top-color: black;
  924. }
  925. .copy-button.copied .tooltip {
  926. display: block;
  927. }
  928. .code-content {
  929. margin: 0;
  930. padding: 0;
  931. }
  932. .code-content pre {
  933. margin: 0;
  934. padding: 10px;
  935. }
  936. </style>
  937. <div class="code-block-container" data-lang="bash">
  938. <div class="code-header">
  939. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  940. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  941. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  942. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  943. </svg>
  944. <span>Copy</span>
  945. <div class="tooltip">Copied!</div>
  946. </button>
  947. </div>
  948. <div class="code-content">
  949. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>Ctrl + Alt + F3</span></span></code></pre></div>
  950. </div>
  951. </div>
  952. <script>
  953. function copyCodeBlock(button) {
  954. const container = button.closest('.code-block-container');
  955. const codeContent = container.querySelector('.code-content pre');
  956. const code = codeContent.textContent;
  957. navigator.clipboard.writeText(code.trim()).then(() => {
  958. button.classList.add('copied');
  959. setTimeout(() => {
  960. button.classList.remove('copied');
  961. }, 2000);
  962. }).catch(err => {
  963. console.error('Failed to copy:', err);
  964. const textarea = document.createElement('textarea');
  965. textarea.value = code.trim();
  966. document.body.appendChild(textarea);
  967. textarea.select();
  968. try {
  969. document.execCommand('copy');
  970. button.classList.add('copied');
  971. setTimeout(() => {
  972. button.classList.remove('copied');
  973. }, 2000);
  974. } catch (e) {
  975. console.error('Fallback failed:', e);
  976. }
  977. document.body.removeChild(textarea);
  978. });
  979. }
  980. </script>
  981. <p>Log in and stop processes using <code>/home</code>:</p>
  982. <style>
  983. .code-block-container {
  984. position: relative;
  985. margin: 1em 0;
  986. border: 1px solid #5E5E5E;
  987. border-radius: 1px;
  988. overflow: hidden;
  989. }
  990. .code-header {
  991. position: absolute;
  992. top: 8px;
  993. right: 8px;
  994. z-index: 999;
  995. }
  996. .copy-button {
  997. display: inline-flex;
  998. align-items: center;
  999. background: #2d2d2d;
  1000. color: white;
  1001. border: 1px solid #404040;
  1002. border-radius: 4px;
  1003. padding: 4px 8px;
  1004. font-size: 0.8em;
  1005. cursor: pointer;
  1006. transition: all 0.2s ease;
  1007. }
  1008. .copy-button:hover {
  1009. background: #404040;
  1010. }
  1011. .copy-button svg {
  1012. width: 14px;
  1013. height: 14px;
  1014. margin-right: 4px;
  1015. }
  1016. .tooltip {
  1017. position: absolute;
  1018. top: -30px;
  1019. left: 50%;
  1020. transform: translateX(-50%);
  1021. background: black;
  1022. color: white;
  1023. padding: 4px 8px;
  1024. border-radius: 4px;
  1025. font-size: 12px;
  1026. display: none;
  1027. }
  1028. .tooltip::after {
  1029. content: "";
  1030. position: absolute;
  1031. top: 100%;
  1032. left: 50%;
  1033. transform: translateX(-50%);
  1034. border: 5px solid transparent;
  1035. border-top-color: black;
  1036. }
  1037. .copy-button.copied .tooltip {
  1038. display: block;
  1039. }
  1040. .code-content {
  1041. margin: 0;
  1042. padding: 0;
  1043. }
  1044. .code-content pre {
  1045. margin: 0;
  1046. padding: 10px;
  1047. }
  1048. </style>
  1049. <div class="code-block-container" data-lang="bash">
  1050. <div class="code-header">
  1051. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1052. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  1053. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  1054. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1055. </svg>
  1056. <span>Copy</span>
  1057. <div class="tooltip">Copied!</div>
  1058. </button>
  1059. </div>
  1060. <div class="code-content">
  1061. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo systemctl stop gdm <span style="color:#6272a4"># For GNOME (or use sddm/lightdm if applicable)</span></span></span></code></pre></div>
  1062. </div>
  1063. </div>
  1064. <script>
  1065. function copyCodeBlock(button) {
  1066. const container = button.closest('.code-block-container');
  1067. const codeContent = container.querySelector('.code-content pre');
  1068. const code = codeContent.textContent;
  1069. navigator.clipboard.writeText(code.trim()).then(() => {
  1070. button.classList.add('copied');
  1071. setTimeout(() => {
  1072. button.classList.remove('copied');
  1073. }, 2000);
  1074. }).catch(err => {
  1075. console.error('Failed to copy:', err);
  1076. const textarea = document.createElement('textarea');
  1077. textarea.value = code.trim();
  1078. document.body.appendChild(textarea);
  1079. textarea.select();
  1080. try {
  1081. document.execCommand('copy');
  1082. button.classList.add('copied');
  1083. setTimeout(() => {
  1084. button.classList.remove('copied');
  1085. }, 2000);
  1086. } catch (e) {
  1087. console.error('Fallback failed:', e);
  1088. }
  1089. document.body.removeChild(textarea);
  1090. });
  1091. }
  1092. </script>
  1093. <p>Unmount and remount:</p>
  1094. <style>
  1095. .code-block-container {
  1096. position: relative;
  1097. margin: 1em 0;
  1098. border: 1px solid #5E5E5E;
  1099. border-radius: 1px;
  1100. overflow: hidden;
  1101. }
  1102. .code-header {
  1103. position: absolute;
  1104. top: 8px;
  1105. right: 8px;
  1106. z-index: 999;
  1107. }
  1108. .copy-button {
  1109. display: inline-flex;
  1110. align-items: center;
  1111. background: #2d2d2d;
  1112. color: white;
  1113. border: 1px solid #404040;
  1114. border-radius: 4px;
  1115. padding: 4px 8px;
  1116. font-size: 0.8em;
  1117. cursor: pointer;
  1118. transition: all 0.2s ease;
  1119. }
  1120. .copy-button:hover {
  1121. background: #404040;
  1122. }
  1123. .copy-button svg {
  1124. width: 14px;
  1125. height: 14px;
  1126. margin-right: 4px;
  1127. }
  1128. .tooltip {
  1129. position: absolute;
  1130. top: -30px;
  1131. left: 50%;
  1132. transform: translateX(-50%);
  1133. background: black;
  1134. color: white;
  1135. padding: 4px 8px;
  1136. border-radius: 4px;
  1137. font-size: 12px;
  1138. display: none;
  1139. }
  1140. .tooltip::after {
  1141. content: "";
  1142. position: absolute;
  1143. top: 100%;
  1144. left: 50%;
  1145. transform: translateX(-50%);
  1146. border: 5px solid transparent;
  1147. border-top-color: black;
  1148. }
  1149. .copy-button.copied .tooltip {
  1150. display: block;
  1151. }
  1152. .code-content {
  1153. margin: 0;
  1154. padding: 0;
  1155. }
  1156. .code-content pre {
  1157. margin: 0;
  1158. padding: 10px;
  1159. }
  1160. </style>
  1161. <div class="code-block-container" data-lang="bash">
  1162. <div class="code-header">
  1163. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1164. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  1165. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  1166. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1167. </svg>
  1168. <span>Copy</span>
  1169. <div class="tooltip">Copied!</div>
  1170. </button>
  1171. </div>
  1172. <div class="code-content">
  1173. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo umount /home
  1174. </span></span><span style="display:flex;"><span>sudo mount /home</span></span></code></pre></div>
  1175. </div>
  1176. </div>
  1177. <script>
  1178. function copyCodeBlock(button) {
  1179. const container = button.closest('.code-block-container');
  1180. const codeContent = container.querySelector('.code-content pre');
  1181. const code = codeContent.textContent;
  1182. navigator.clipboard.writeText(code.trim()).then(() => {
  1183. button.classList.add('copied');
  1184. setTimeout(() => {
  1185. button.classList.remove('copied');
  1186. }, 2000);
  1187. }).catch(err => {
  1188. console.error('Failed to copy:', err);
  1189. const textarea = document.createElement('textarea');
  1190. textarea.value = code.trim();
  1191. document.body.appendChild(textarea);
  1192. textarea.select();
  1193. try {
  1194. document.execCommand('copy');
  1195. button.classList.add('copied');
  1196. setTimeout(() => {
  1197. button.classList.remove('copied');
  1198. }, 2000);
  1199. } catch (e) {
  1200. console.error('Fallback failed:', e);
  1201. }
  1202. document.body.removeChild(textarea);
  1203. });
  1204. }
  1205. </script>
  1206. <hr>
  1207. <h2 id="6-verify-and-reboot"><strong>6. Verify and Reboot</strong></h2>
  1208. <p>Check that everything is in place:</p>
  1209. <style>
  1210. .code-block-container {
  1211. position: relative;
  1212. margin: 1em 0;
  1213. border: 1px solid #5E5E5E;
  1214. border-radius: 1px;
  1215. overflow: hidden;
  1216. }
  1217. .code-header {
  1218. position: absolute;
  1219. top: 8px;
  1220. right: 8px;
  1221. z-index: 999;
  1222. }
  1223. .copy-button {
  1224. display: inline-flex;
  1225. align-items: center;
  1226. background: #2d2d2d;
  1227. color: white;
  1228. border: 1px solid #404040;
  1229. border-radius: 4px;
  1230. padding: 4px 8px;
  1231. font-size: 0.8em;
  1232. cursor: pointer;
  1233. transition: all 0.2s ease;
  1234. }
  1235. .copy-button:hover {
  1236. background: #404040;
  1237. }
  1238. .copy-button svg {
  1239. width: 14px;
  1240. height: 14px;
  1241. margin-right: 4px;
  1242. }
  1243. .tooltip {
  1244. position: absolute;
  1245. top: -30px;
  1246. left: 50%;
  1247. transform: translateX(-50%);
  1248. background: black;
  1249. color: white;
  1250. padding: 4px 8px;
  1251. border-radius: 4px;
  1252. font-size: 12px;
  1253. display: none;
  1254. }
  1255. .tooltip::after {
  1256. content: "";
  1257. position: absolute;
  1258. top: 100%;
  1259. left: 50%;
  1260. transform: translateX(-50%);
  1261. border: 5px solid transparent;
  1262. border-top-color: black;
  1263. }
  1264. .copy-button.copied .tooltip {
  1265. display: block;
  1266. }
  1267. .code-content {
  1268. margin: 0;
  1269. padding: 0;
  1270. }
  1271. .code-content pre {
  1272. margin: 0;
  1273. padding: 10px;
  1274. }
  1275. </style>
  1276. <div class="code-block-container" data-lang="bash">
  1277. <div class="code-header">
  1278. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1279. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  1280. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  1281. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1282. </svg>
  1283. <span>Copy</span>
  1284. <div class="tooltip">Copied!</div>
  1285. </button>
  1286. </div>
  1287. <div class="code-content">
  1288. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>ls /home</span></span></code></pre></div>
  1289. </div>
  1290. </div>
  1291. <script>
  1292. function copyCodeBlock(button) {
  1293. const container = button.closest('.code-block-container');
  1294. const codeContent = container.querySelector('.code-content pre');
  1295. const code = codeContent.textContent;
  1296. navigator.clipboard.writeText(code.trim()).then(() => {
  1297. button.classList.add('copied');
  1298. setTimeout(() => {
  1299. button.classList.remove('copied');
  1300. }, 2000);
  1301. }).catch(err => {
  1302. console.error('Failed to copy:', err);
  1303. const textarea = document.createElement('textarea');
  1304. textarea.value = code.trim();
  1305. document.body.appendChild(textarea);
  1306. textarea.select();
  1307. try {
  1308. document.execCommand('copy');
  1309. button.classList.add('copied');
  1310. setTimeout(() => {
  1311. button.classList.remove('copied');
  1312. }, 2000);
  1313. } catch (e) {
  1314. console.error('Fallback failed:', e);
  1315. }
  1316. document.body.removeChild(textarea);
  1317. });
  1318. }
  1319. </script>
  1320. <p>If everything looks good, reboot:</p>
  1321. <style>
  1322. .code-block-container {
  1323. position: relative;
  1324. margin: 1em 0;
  1325. border: 1px solid #5E5E5E;
  1326. border-radius: 1px;
  1327. overflow: hidden;
  1328. }
  1329. .code-header {
  1330. position: absolute;
  1331. top: 8px;
  1332. right: 8px;
  1333. z-index: 999;
  1334. }
  1335. .copy-button {
  1336. display: inline-flex;
  1337. align-items: center;
  1338. background: #2d2d2d;
  1339. color: white;
  1340. border: 1px solid #404040;
  1341. border-radius: 4px;
  1342. padding: 4px 8px;
  1343. font-size: 0.8em;
  1344. cursor: pointer;
  1345. transition: all 0.2s ease;
  1346. }
  1347. .copy-button:hover {
  1348. background: #404040;
  1349. }
  1350. .copy-button svg {
  1351. width: 14px;
  1352. height: 14px;
  1353. margin-right: 4px;
  1354. }
  1355. .tooltip {
  1356. position: absolute;
  1357. top: -30px;
  1358. left: 50%;
  1359. transform: translateX(-50%);
  1360. background: black;
  1361. color: white;
  1362. padding: 4px 8px;
  1363. border-radius: 4px;
  1364. font-size: 12px;
  1365. display: none;
  1366. }
  1367. .tooltip::after {
  1368. content: "";
  1369. position: absolute;
  1370. top: 100%;
  1371. left: 50%;
  1372. transform: translateX(-50%);
  1373. border: 5px solid transparent;
  1374. border-top-color: black;
  1375. }
  1376. .copy-button.copied .tooltip {
  1377. display: block;
  1378. }
  1379. .code-content {
  1380. margin: 0;
  1381. padding: 0;
  1382. }
  1383. .code-content pre {
  1384. margin: 0;
  1385. padding: 10px;
  1386. }
  1387. </style>
  1388. <div class="code-block-container" data-lang="bash">
  1389. <div class="code-header">
  1390. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1391. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  1392. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  1393. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1394. </svg>
  1395. <span>Copy</span>
  1396. <div class="tooltip">Copied!</div>
  1397. </button>
  1398. </div>
  1399. <div class="code-content">
  1400. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo reboot</span></span></code></pre></div>
  1401. </div>
  1402. </div>
  1403. <script>
  1404. function copyCodeBlock(button) {
  1405. const container = button.closest('.code-block-container');
  1406. const codeContent = container.querySelector('.code-content pre');
  1407. const code = codeContent.textContent;
  1408. navigator.clipboard.writeText(code.trim()).then(() => {
  1409. button.classList.add('copied');
  1410. setTimeout(() => {
  1411. button.classList.remove('copied');
  1412. }, 2000);
  1413. }).catch(err => {
  1414. console.error('Failed to copy:', err);
  1415. const textarea = document.createElement('textarea');
  1416. textarea.value = code.trim();
  1417. document.body.appendChild(textarea);
  1418. textarea.select();
  1419. try {
  1420. document.execCommand('copy');
  1421. button.classList.add('copied');
  1422. setTimeout(() => {
  1423. button.classList.remove('copied');
  1424. }, 2000);
  1425. } catch (e) {
  1426. console.error('Fallback failed:', e);
  1427. }
  1428. document.body.removeChild(textarea);
  1429. });
  1430. }
  1431. </script>
  1432. <hr>
  1433. <h1 id="things-to-keep-in-mind">Things to Keep in Mind</h1>
  1434. <ul>
  1435. <li>
  1436. <p>If you&rsquo;re logged in as a regular user, switch to a root shell (sudo -i) or use a temporary user with administrative privileges.</p>
  1437. </li>
  1438. <li>
  1439. <p>If you face permission issues, you might need to reapply ownership:</p>
  1440. </li>
  1441. </ul>
  1442. <style>
  1443. .code-block-container {
  1444. position: relative;
  1445. margin: 1em 0;
  1446. border: 1px solid #5E5E5E;
  1447. border-radius: 1px;
  1448. overflow: hidden;
  1449. }
  1450. .code-header {
  1451. position: absolute;
  1452. top: 8px;
  1453. right: 8px;
  1454. z-index: 999;
  1455. }
  1456. .copy-button {
  1457. display: inline-flex;
  1458. align-items: center;
  1459. background: #2d2d2d;
  1460. color: white;
  1461. border: 1px solid #404040;
  1462. border-radius: 4px;
  1463. padding: 4px 8px;
  1464. font-size: 0.8em;
  1465. cursor: pointer;
  1466. transition: all 0.2s ease;
  1467. }
  1468. .copy-button:hover {
  1469. background: #404040;
  1470. }
  1471. .copy-button svg {
  1472. width: 14px;
  1473. height: 14px;
  1474. margin-right: 4px;
  1475. }
  1476. .tooltip {
  1477. position: absolute;
  1478. top: -30px;
  1479. left: 50%;
  1480. transform: translateX(-50%);
  1481. background: black;
  1482. color: white;
  1483. padding: 4px 8px;
  1484. border-radius: 4px;
  1485. font-size: 12px;
  1486. display: none;
  1487. }
  1488. .tooltip::after {
  1489. content: "";
  1490. position: absolute;
  1491. top: 100%;
  1492. left: 50%;
  1493. transform: translateX(-50%);
  1494. border: 5px solid transparent;
  1495. border-top-color: black;
  1496. }
  1497. .copy-button.copied .tooltip {
  1498. display: block;
  1499. }
  1500. .code-content {
  1501. margin: 0;
  1502. padding: 0;
  1503. }
  1504. .code-content pre {
  1505. margin: 0;
  1506. padding: 10px;
  1507. }
  1508. </style>
  1509. <div class="code-block-container" data-lang="bash">
  1510. <div class="code-header">
  1511. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1512. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  1513. <path d="M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z"/>
  1514. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1515. </svg>
  1516. <span>Copy</span>
  1517. <div class="tooltip">Copied!</div>
  1518. </button>
  1519. </div>
  1520. <div class="code-content">
  1521. <div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo chown -R username:username /home/username</span></span></code></pre></div>
  1522. </div>
  1523. </div>
  1524. <script>
  1525. function copyCodeBlock(button) {
  1526. const container = button.closest('.code-block-container');
  1527. const codeContent = container.querySelector('.code-content pre');
  1528. const code = codeContent.textContent;
  1529. navigator.clipboard.writeText(code.trim()).then(() => {
  1530. button.classList.add('copied');
  1531. setTimeout(() => {
  1532. button.classList.remove('copied');
  1533. }, 2000);
  1534. }).catch(err => {
  1535. console.error('Failed to copy:', err);
  1536. const textarea = document.createElement('textarea');
  1537. textarea.value = code.trim();
  1538. document.body.appendChild(textarea);
  1539. textarea.select();
  1540. try {
  1541. document.execCommand('copy');
  1542. button.classList.add('copied');
  1543. setTimeout(() => {
  1544. button.classList.remove('copied');
  1545. }, 2000);
  1546. } catch (e) {
  1547. console.error('Fallback failed:', e);
  1548. }
  1549. document.body.removeChild(textarea);
  1550. });
  1551. }
  1552. </script>
  1553. </div>
  1554. </div>
  1555. </main>
  1556. </div>
  1557. <footer class="footer">
  1558. <span>CC 2025, Built with <a href="https://gohugo.io" class="footerLink">Hugo</a></span>
  1559. </footer>
  1560. </div>
  1561. </body>
  1562. </html>