index.html 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618
  1. <!DOCTYPE html>
  2. <html lang="en-us">
  3. <head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=55173&amp;path=livereload" data-no-instant defer></script>
  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="http://localhost:55173/posts/2025/move_home_folder/" >
  12. <link href="/css/style.min.ee0d47e4d4346c71a65a9e873108c81ffae54d60a2fc2338f6df394eb4b25a82.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="http://localhost:55173/">
  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="http://localhost:55173/posts/" title="" >
  29. ~/posts</a>
  30. </li>
  31. <li>
  32. <a href="http://localhost:55173/projects/" title="" >
  33. ~/projects</a>
  34. </li>
  35. <li>
  36. <a href="http://localhost:55173/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. }
  82. .code-header {
  83. position: absolute;
  84. top: 8px;
  85. right: 8px;
  86. z-index: 999;
  87. }
  88. .copy-button {
  89. display: inline-flex;
  90. align-items: center;
  91. background: #2d2d2d;
  92. color: white;
  93. border: 1px solid #404040;
  94. border-radius: 4px;
  95. padding: 4px 8px;
  96. font-size: 0.8em;
  97. cursor: pointer;
  98. transition: all 0.2s ease;
  99. }
  100. .copy-button:hover {
  101. background: #404040;
  102. }
  103. .copy-button svg {
  104. width: 14px;
  105. height: 14px;
  106. margin-right: 4px;
  107. }
  108. .tooltip {
  109. position: absolute;
  110. top: -30px;
  111. left: 50%;
  112. transform: translateX(-50%);
  113. background: black;
  114. color: white;
  115. padding: 4px 8px;
  116. border-radius: 4px;
  117. font-size: 12px;
  118. display: none;
  119. }
  120. .tooltip::after {
  121. content: "";
  122. position: absolute;
  123. top: 100%;
  124. left: 50%;
  125. transform: translateX(-50%);
  126. border: 5px solid transparent;
  127. border-top-color: black;
  128. }
  129. .copy-button.copied .tooltip {
  130. display: block;
  131. }
  132. </style>
  133. <div class="code-block-container" data-lang="bash">
  134. <div class="code-header">
  135. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  136. <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">
  137. <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"/>
  138. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  139. </svg>
  140. <span>Copy</span>
  141. <div class="tooltip">Copied!</div>
  142. </button>
  143. </div>
  144. <div class="code-content">
  145. <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>
  146. </div>
  147. </div>
  148. <script>
  149. function copyCodeBlock(button) {
  150. const container = button.closest('.code-block-container');
  151. const codeContent = container.querySelector('.code-content pre');
  152. const code = codeContent.textContent;
  153. navigator.clipboard.writeText(code.trim()).then(() => {
  154. button.classList.add('copied');
  155. setTimeout(() => {
  156. button.classList.remove('copied');
  157. }, 2000);
  158. }).catch(err => {
  159. console.error('Failed to copy:', err);
  160. const textarea = document.createElement('textarea');
  161. textarea.value = code.trim();
  162. document.body.appendChild(textarea);
  163. textarea.select();
  164. try {
  165. document.execCommand('copy');
  166. button.classList.add('copied');
  167. setTimeout(() => {
  168. button.classList.remove('copied');
  169. }, 2000);
  170. } catch (e) {
  171. console.error('Fallback failed:', e);
  172. }
  173. document.body.removeChild(textarea);
  174. });
  175. }
  176. </script>
  177. <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>
  178. <p>If you&rsquo;re moving /home to a different partition or disk, make sure it&rsquo;s properly formatted and mounted.</p>
  179. <p>For example, if you want to use a new disk (e.g., <code>/dev/sdb1</code>):</p>
  180. <style>
  181. .code-block-container {
  182. position: relative;
  183. margin: 1em 0;
  184. }
  185. .code-header {
  186. position: absolute;
  187. top: 8px;
  188. right: 8px;
  189. z-index: 999;
  190. }
  191. .copy-button {
  192. display: inline-flex;
  193. align-items: center;
  194. background: #2d2d2d;
  195. color: white;
  196. border: 1px solid #404040;
  197. border-radius: 4px;
  198. padding: 4px 8px;
  199. font-size: 0.8em;
  200. cursor: pointer;
  201. transition: all 0.2s ease;
  202. }
  203. .copy-button:hover {
  204. background: #404040;
  205. }
  206. .copy-button svg {
  207. width: 14px;
  208. height: 14px;
  209. margin-right: 4px;
  210. }
  211. .tooltip {
  212. position: absolute;
  213. top: -30px;
  214. left: 50%;
  215. transform: translateX(-50%);
  216. background: black;
  217. color: white;
  218. padding: 4px 8px;
  219. border-radius: 4px;
  220. font-size: 12px;
  221. display: none;
  222. }
  223. .tooltip::after {
  224. content: "";
  225. position: absolute;
  226. top: 100%;
  227. left: 50%;
  228. transform: translateX(-50%);
  229. border: 5px solid transparent;
  230. border-top-color: black;
  231. }
  232. .copy-button.copied .tooltip {
  233. display: block;
  234. }
  235. </style>
  236. <div class="code-block-container" data-lang="bash">
  237. <div class="code-header">
  238. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  239. <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">
  240. <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"/>
  241. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  242. </svg>
  243. <span>Copy</span>
  244. <div class="tooltip">Copied!</div>
  245. </button>
  246. </div>
  247. <div class="code-content">
  248. <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
  249. </span></span><span style="display:flex;"><span>sudo mkdir /mnt/newhome
  250. </span></span><span style="display:flex;"><span>sudo mount /dev/sdb1 /mnt/newhome</span></span></code></pre></div>
  251. </div>
  252. </div>
  253. <script>
  254. function copyCodeBlock(button) {
  255. const container = button.closest('.code-block-container');
  256. const codeContent = container.querySelector('.code-content pre');
  257. const code = codeContent.textContent;
  258. navigator.clipboard.writeText(code.trim()).then(() => {
  259. button.classList.add('copied');
  260. setTimeout(() => {
  261. button.classList.remove('copied');
  262. }, 2000);
  263. }).catch(err => {
  264. console.error('Failed to copy:', err);
  265. const textarea = document.createElement('textarea');
  266. textarea.value = code.trim();
  267. document.body.appendChild(textarea);
  268. textarea.select();
  269. try {
  270. document.execCommand('copy');
  271. button.classList.add('copied');
  272. setTimeout(() => {
  273. button.classList.remove('copied');
  274. }, 2000);
  275. } catch (e) {
  276. console.error('Fallback failed:', e);
  277. }
  278. document.body.removeChild(textarea);
  279. });
  280. }
  281. </script>
  282. <h2 id="3-copy-the-home-folder"><strong>3. Copy the Home Folder</strong></h2>
  283. <p>Copy all user data to the new location while preserving permissions:</p>
  284. <style>
  285. .code-block-container {
  286. position: relative;
  287. margin: 1em 0;
  288. }
  289. .code-header {
  290. position: absolute;
  291. top: 8px;
  292. right: 8px;
  293. z-index: 999;
  294. }
  295. .copy-button {
  296. display: inline-flex;
  297. align-items: center;
  298. background: #2d2d2d;
  299. color: white;
  300. border: 1px solid #404040;
  301. border-radius: 4px;
  302. padding: 4px 8px;
  303. font-size: 0.8em;
  304. cursor: pointer;
  305. transition: all 0.2s ease;
  306. }
  307. .copy-button:hover {
  308. background: #404040;
  309. }
  310. .copy-button svg {
  311. width: 14px;
  312. height: 14px;
  313. margin-right: 4px;
  314. }
  315. .tooltip {
  316. position: absolute;
  317. top: -30px;
  318. left: 50%;
  319. transform: translateX(-50%);
  320. background: black;
  321. color: white;
  322. padding: 4px 8px;
  323. border-radius: 4px;
  324. font-size: 12px;
  325. display: none;
  326. }
  327. .tooltip::after {
  328. content: "";
  329. position: absolute;
  330. top: 100%;
  331. left: 50%;
  332. transform: translateX(-50%);
  333. border: 5px solid transparent;
  334. border-top-color: black;
  335. }
  336. .copy-button.copied .tooltip {
  337. display: block;
  338. }
  339. </style>
  340. <div class="code-block-container" data-lang="bash">
  341. <div class="code-header">
  342. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  343. <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">
  344. <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"/>
  345. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  346. </svg>
  347. <span>Copy</span>
  348. <div class="tooltip">Copied!</div>
  349. </button>
  350. </div>
  351. <div class="code-content">
  352. <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>
  353. </div>
  354. </div>
  355. <script>
  356. function copyCodeBlock(button) {
  357. const container = button.closest('.code-block-container');
  358. const codeContent = container.querySelector('.code-content pre');
  359. const code = codeContent.textContent;
  360. navigator.clipboard.writeText(code.trim()).then(() => {
  361. button.classList.add('copied');
  362. setTimeout(() => {
  363. button.classList.remove('copied');
  364. }, 2000);
  365. }).catch(err => {
  366. console.error('Failed to copy:', err);
  367. const textarea = document.createElement('textarea');
  368. textarea.value = code.trim();
  369. document.body.appendChild(textarea);
  370. textarea.select();
  371. try {
  372. document.execCommand('copy');
  373. button.classList.add('copied');
  374. setTimeout(() => {
  375. button.classList.remove('copied');
  376. }, 2000);
  377. } catch (e) {
  378. console.error('Fallback failed:', e);
  379. }
  380. document.body.removeChild(textarea);
  381. });
  382. }
  383. </script>
  384. <hr>
  385. <h2 id="4-update-fstab"><strong>4. Update fstab</strong></h2>
  386. <p>Edit /etc/fstab to mount the new home directory at boot.</p>
  387. <style>
  388. .code-block-container {
  389. position: relative;
  390. margin: 1em 0;
  391. }
  392. .code-header {
  393. position: absolute;
  394. top: 8px;
  395. right: 8px;
  396. z-index: 999;
  397. }
  398. .copy-button {
  399. display: inline-flex;
  400. align-items: center;
  401. background: #2d2d2d;
  402. color: white;
  403. border: 1px solid #404040;
  404. border-radius: 4px;
  405. padding: 4px 8px;
  406. font-size: 0.8em;
  407. cursor: pointer;
  408. transition: all 0.2s ease;
  409. }
  410. .copy-button:hover {
  411. background: #404040;
  412. }
  413. .copy-button svg {
  414. width: 14px;
  415. height: 14px;
  416. margin-right: 4px;
  417. }
  418. .tooltip {
  419. position: absolute;
  420. top: -30px;
  421. left: 50%;
  422. transform: translateX(-50%);
  423. background: black;
  424. color: white;
  425. padding: 4px 8px;
  426. border-radius: 4px;
  427. font-size: 12px;
  428. display: none;
  429. }
  430. .tooltip::after {
  431. content: "";
  432. position: absolute;
  433. top: 100%;
  434. left: 50%;
  435. transform: translateX(-50%);
  436. border: 5px solid transparent;
  437. border-top-color: black;
  438. }
  439. .copy-button.copied .tooltip {
  440. display: block;
  441. }
  442. </style>
  443. <div class="code-block-container" data-lang="bash">
  444. <div class="code-header">
  445. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  446. <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">
  447. <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"/>
  448. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  449. </svg>
  450. <span>Copy</span>
  451. <div class="tooltip">Copied!</div>
  452. </button>
  453. </div>
  454. <div class="code-content">
  455. <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>
  456. </div>
  457. </div>
  458. <script>
  459. function copyCodeBlock(button) {
  460. const container = button.closest('.code-block-container');
  461. const codeContent = container.querySelector('.code-content pre');
  462. const code = codeContent.textContent;
  463. navigator.clipboard.writeText(code.trim()).then(() => {
  464. button.classList.add('copied');
  465. setTimeout(() => {
  466. button.classList.remove('copied');
  467. }, 2000);
  468. }).catch(err => {
  469. console.error('Failed to copy:', err);
  470. const textarea = document.createElement('textarea');
  471. textarea.value = code.trim();
  472. document.body.appendChild(textarea);
  473. textarea.select();
  474. try {
  475. document.execCommand('copy');
  476. button.classList.add('copied');
  477. setTimeout(() => {
  478. button.classList.remove('copied');
  479. }, 2000);
  480. } catch (e) {
  481. console.error('Fallback failed:', e);
  482. }
  483. document.body.removeChild(textarea);
  484. });
  485. }
  486. </script>
  487. <p>Add this line at the end (adjust the path accordingly):</p>
  488. <style>
  489. .code-block-container {
  490. position: relative;
  491. margin: 1em 0;
  492. }
  493. .code-header {
  494. position: absolute;
  495. top: 8px;
  496. right: 8px;
  497. z-index: 999;
  498. }
  499. .copy-button {
  500. display: inline-flex;
  501. align-items: center;
  502. background: #2d2d2d;
  503. color: white;
  504. border: 1px solid #404040;
  505. border-radius: 4px;
  506. padding: 4px 8px;
  507. font-size: 0.8em;
  508. cursor: pointer;
  509. transition: all 0.2s ease;
  510. }
  511. .copy-button:hover {
  512. background: #404040;
  513. }
  514. .copy-button svg {
  515. width: 14px;
  516. height: 14px;
  517. margin-right: 4px;
  518. }
  519. .tooltip {
  520. position: absolute;
  521. top: -30px;
  522. left: 50%;
  523. transform: translateX(-50%);
  524. background: black;
  525. color: white;
  526. padding: 4px 8px;
  527. border-radius: 4px;
  528. font-size: 12px;
  529. display: none;
  530. }
  531. .tooltip::after {
  532. content: "";
  533. position: absolute;
  534. top: 100%;
  535. left: 50%;
  536. transform: translateX(-50%);
  537. border: 5px solid transparent;
  538. border-top-color: black;
  539. }
  540. .copy-button.copied .tooltip {
  541. display: block;
  542. }
  543. </style>
  544. <div class="code-block-container" data-lang="bash">
  545. <div class="code-header">
  546. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  547. <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">
  548. <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"/>
  549. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  550. </svg>
  551. <span>Copy</span>
  552. <div class="tooltip">Copied!</div>
  553. </button>
  554. </div>
  555. <div class="code-content">
  556. <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>
  557. </div>
  558. </div>
  559. <script>
  560. function copyCodeBlock(button) {
  561. const container = button.closest('.code-block-container');
  562. const codeContent = container.querySelector('.code-content pre');
  563. const code = codeContent.textContent;
  564. navigator.clipboard.writeText(code.trim()).then(() => {
  565. button.classList.add('copied');
  566. setTimeout(() => {
  567. button.classList.remove('copied');
  568. }, 2000);
  569. }).catch(err => {
  570. console.error('Failed to copy:', err);
  571. const textarea = document.createElement('textarea');
  572. textarea.value = code.trim();
  573. document.body.appendChild(textarea);
  574. textarea.select();
  575. try {
  576. document.execCommand('copy');
  577. button.classList.add('copied');
  578. setTimeout(() => {
  579. button.classList.remove('copied');
  580. }, 2000);
  581. } catch (e) {
  582. console.error('Fallback failed:', e);
  583. }
  584. document.body.removeChild(textarea);
  585. });
  586. }
  587. </script>
  588. <p>If you prefer using the UUID, first find it:</p>
  589. <style>
  590. .code-block-container {
  591. position: relative;
  592. margin: 1em 0;
  593. }
  594. .code-header {
  595. position: absolute;
  596. top: 8px;
  597. right: 8px;
  598. z-index: 999;
  599. }
  600. .copy-button {
  601. display: inline-flex;
  602. align-items: center;
  603. background: #2d2d2d;
  604. color: white;
  605. border: 1px solid #404040;
  606. border-radius: 4px;
  607. padding: 4px 8px;
  608. font-size: 0.8em;
  609. cursor: pointer;
  610. transition: all 0.2s ease;
  611. }
  612. .copy-button:hover {
  613. background: #404040;
  614. }
  615. .copy-button svg {
  616. width: 14px;
  617. height: 14px;
  618. margin-right: 4px;
  619. }
  620. .tooltip {
  621. position: absolute;
  622. top: -30px;
  623. left: 50%;
  624. transform: translateX(-50%);
  625. background: black;
  626. color: white;
  627. padding: 4px 8px;
  628. border-radius: 4px;
  629. font-size: 12px;
  630. display: none;
  631. }
  632. .tooltip::after {
  633. content: "";
  634. position: absolute;
  635. top: 100%;
  636. left: 50%;
  637. transform: translateX(-50%);
  638. border: 5px solid transparent;
  639. border-top-color: black;
  640. }
  641. .copy-button.copied .tooltip {
  642. display: block;
  643. }
  644. </style>
  645. <div class="code-block-container" data-lang="bash">
  646. <div class="code-header">
  647. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  648. <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">
  649. <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"/>
  650. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  651. </svg>
  652. <span>Copy</span>
  653. <div class="tooltip">Copied!</div>
  654. </button>
  655. </div>
  656. <div class="code-content">
  657. <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>
  658. </div>
  659. </div>
  660. <script>
  661. function copyCodeBlock(button) {
  662. const container = button.closest('.code-block-container');
  663. const codeContent = container.querySelector('.code-content pre');
  664. const code = codeContent.textContent;
  665. navigator.clipboard.writeText(code.trim()).then(() => {
  666. button.classList.add('copied');
  667. setTimeout(() => {
  668. button.classList.remove('copied');
  669. }, 2000);
  670. }).catch(err => {
  671. console.error('Failed to copy:', err);
  672. const textarea = document.createElement('textarea');
  673. textarea.value = code.trim();
  674. document.body.appendChild(textarea);
  675. textarea.select();
  676. try {
  677. document.execCommand('copy');
  678. button.classList.add('copied');
  679. setTimeout(() => {
  680. button.classList.remove('copied');
  681. }, 2000);
  682. } catch (e) {
  683. console.error('Fallback failed:', e);
  684. }
  685. document.body.removeChild(textarea);
  686. });
  687. }
  688. </script>
  689. <p>Then, add this line instead:</p>
  690. <style>
  691. .code-block-container {
  692. position: relative;
  693. margin: 1em 0;
  694. }
  695. .code-header {
  696. position: absolute;
  697. top: 8px;
  698. right: 8px;
  699. z-index: 999;
  700. }
  701. .copy-button {
  702. display: inline-flex;
  703. align-items: center;
  704. background: #2d2d2d;
  705. color: white;
  706. border: 1px solid #404040;
  707. border-radius: 4px;
  708. padding: 4px 8px;
  709. font-size: 0.8em;
  710. cursor: pointer;
  711. transition: all 0.2s ease;
  712. }
  713. .copy-button:hover {
  714. background: #404040;
  715. }
  716. .copy-button svg {
  717. width: 14px;
  718. height: 14px;
  719. margin-right: 4px;
  720. }
  721. .tooltip {
  722. position: absolute;
  723. top: -30px;
  724. left: 50%;
  725. transform: translateX(-50%);
  726. background: black;
  727. color: white;
  728. padding: 4px 8px;
  729. border-radius: 4px;
  730. font-size: 12px;
  731. display: none;
  732. }
  733. .tooltip::after {
  734. content: "";
  735. position: absolute;
  736. top: 100%;
  737. left: 50%;
  738. transform: translateX(-50%);
  739. border: 5px solid transparent;
  740. border-top-color: black;
  741. }
  742. .copy-button.copied .tooltip {
  743. display: block;
  744. }
  745. </style>
  746. <div class="code-block-container" data-lang="arduino">
  747. <div class="code-header">
  748. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  749. <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">
  750. <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"/>
  751. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  752. </svg>
  753. <span>Copy</span>
  754. <div class="tooltip">Copied!</div>
  755. </button>
  756. </div>
  757. <div class="code-content">
  758. <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>
  759. </div>
  760. </div>
  761. <script>
  762. function copyCodeBlock(button) {
  763. const container = button.closest('.code-block-container');
  764. const codeContent = container.querySelector('.code-content pre');
  765. const code = codeContent.textContent;
  766. navigator.clipboard.writeText(code.trim()).then(() => {
  767. button.classList.add('copied');
  768. setTimeout(() => {
  769. button.classList.remove('copied');
  770. }, 2000);
  771. }).catch(err => {
  772. console.error('Failed to copy:', err);
  773. const textarea = document.createElement('textarea');
  774. textarea.value = code.trim();
  775. document.body.appendChild(textarea);
  776. textarea.select();
  777. try {
  778. document.execCommand('copy');
  779. button.classList.add('copied');
  780. setTimeout(() => {
  781. button.classList.remove('copied');
  782. }, 2000);
  783. } catch (e) {
  784. console.error('Fallback failed:', e);
  785. }
  786. document.body.removeChild(textarea);
  787. });
  788. }
  789. </script>
  790. <hr>
  791. <h2 id="5-unmount-old-home-and-mount-new-one"><strong>5. Unmount Old Home and Mount New One</strong></h2>
  792. <p>Switch to a different session (e.g., TTY):</p>
  793. <style>
  794. .code-block-container {
  795. position: relative;
  796. margin: 1em 0;
  797. }
  798. .code-header {
  799. position: absolute;
  800. top: 8px;
  801. right: 8px;
  802. z-index: 999;
  803. }
  804. .copy-button {
  805. display: inline-flex;
  806. align-items: center;
  807. background: #2d2d2d;
  808. color: white;
  809. border: 1px solid #404040;
  810. border-radius: 4px;
  811. padding: 4px 8px;
  812. font-size: 0.8em;
  813. cursor: pointer;
  814. transition: all 0.2s ease;
  815. }
  816. .copy-button:hover {
  817. background: #404040;
  818. }
  819. .copy-button svg {
  820. width: 14px;
  821. height: 14px;
  822. margin-right: 4px;
  823. }
  824. .tooltip {
  825. position: absolute;
  826. top: -30px;
  827. left: 50%;
  828. transform: translateX(-50%);
  829. background: black;
  830. color: white;
  831. padding: 4px 8px;
  832. border-radius: 4px;
  833. font-size: 12px;
  834. display: none;
  835. }
  836. .tooltip::after {
  837. content: "";
  838. position: absolute;
  839. top: 100%;
  840. left: 50%;
  841. transform: translateX(-50%);
  842. border: 5px solid transparent;
  843. border-top-color: black;
  844. }
  845. .copy-button.copied .tooltip {
  846. display: block;
  847. }
  848. </style>
  849. <div class="code-block-container" data-lang="bash">
  850. <div class="code-header">
  851. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  852. <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">
  853. <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"/>
  854. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  855. </svg>
  856. <span>Copy</span>
  857. <div class="tooltip">Copied!</div>
  858. </button>
  859. </div>
  860. <div class="code-content">
  861. <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>
  862. </div>
  863. </div>
  864. <script>
  865. function copyCodeBlock(button) {
  866. const container = button.closest('.code-block-container');
  867. const codeContent = container.querySelector('.code-content pre');
  868. const code = codeContent.textContent;
  869. navigator.clipboard.writeText(code.trim()).then(() => {
  870. button.classList.add('copied');
  871. setTimeout(() => {
  872. button.classList.remove('copied');
  873. }, 2000);
  874. }).catch(err => {
  875. console.error('Failed to copy:', err);
  876. const textarea = document.createElement('textarea');
  877. textarea.value = code.trim();
  878. document.body.appendChild(textarea);
  879. textarea.select();
  880. try {
  881. document.execCommand('copy');
  882. button.classList.add('copied');
  883. setTimeout(() => {
  884. button.classList.remove('copied');
  885. }, 2000);
  886. } catch (e) {
  887. console.error('Fallback failed:', e);
  888. }
  889. document.body.removeChild(textarea);
  890. });
  891. }
  892. </script>
  893. <p>Log in and stop processes using <code>/home</code>:</p>
  894. <style>
  895. .code-block-container {
  896. position: relative;
  897. margin: 1em 0;
  898. }
  899. .code-header {
  900. position: absolute;
  901. top: 8px;
  902. right: 8px;
  903. z-index: 999;
  904. }
  905. .copy-button {
  906. display: inline-flex;
  907. align-items: center;
  908. background: #2d2d2d;
  909. color: white;
  910. border: 1px solid #404040;
  911. border-radius: 4px;
  912. padding: 4px 8px;
  913. font-size: 0.8em;
  914. cursor: pointer;
  915. transition: all 0.2s ease;
  916. }
  917. .copy-button:hover {
  918. background: #404040;
  919. }
  920. .copy-button svg {
  921. width: 14px;
  922. height: 14px;
  923. margin-right: 4px;
  924. }
  925. .tooltip {
  926. position: absolute;
  927. top: -30px;
  928. left: 50%;
  929. transform: translateX(-50%);
  930. background: black;
  931. color: white;
  932. padding: 4px 8px;
  933. border-radius: 4px;
  934. font-size: 12px;
  935. display: none;
  936. }
  937. .tooltip::after {
  938. content: "";
  939. position: absolute;
  940. top: 100%;
  941. left: 50%;
  942. transform: translateX(-50%);
  943. border: 5px solid transparent;
  944. border-top-color: black;
  945. }
  946. .copy-button.copied .tooltip {
  947. display: block;
  948. }
  949. </style>
  950. <div class="code-block-container" data-lang="bash">
  951. <div class="code-header">
  952. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  953. <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">
  954. <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"/>
  955. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  956. </svg>
  957. <span>Copy</span>
  958. <div class="tooltip">Copied!</div>
  959. </button>
  960. </div>
  961. <div class="code-content">
  962. <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>
  963. </div>
  964. </div>
  965. <script>
  966. function copyCodeBlock(button) {
  967. const container = button.closest('.code-block-container');
  968. const codeContent = container.querySelector('.code-content pre');
  969. const code = codeContent.textContent;
  970. navigator.clipboard.writeText(code.trim()).then(() => {
  971. button.classList.add('copied');
  972. setTimeout(() => {
  973. button.classList.remove('copied');
  974. }, 2000);
  975. }).catch(err => {
  976. console.error('Failed to copy:', err);
  977. const textarea = document.createElement('textarea');
  978. textarea.value = code.trim();
  979. document.body.appendChild(textarea);
  980. textarea.select();
  981. try {
  982. document.execCommand('copy');
  983. button.classList.add('copied');
  984. setTimeout(() => {
  985. button.classList.remove('copied');
  986. }, 2000);
  987. } catch (e) {
  988. console.error('Fallback failed:', e);
  989. }
  990. document.body.removeChild(textarea);
  991. });
  992. }
  993. </script>
  994. <p>Unmount and remount:</p>
  995. <style>
  996. .code-block-container {
  997. position: relative;
  998. margin: 1em 0;
  999. }
  1000. .code-header {
  1001. position: absolute;
  1002. top: 8px;
  1003. right: 8px;
  1004. z-index: 999;
  1005. }
  1006. .copy-button {
  1007. display: inline-flex;
  1008. align-items: center;
  1009. background: #2d2d2d;
  1010. color: white;
  1011. border: 1px solid #404040;
  1012. border-radius: 4px;
  1013. padding: 4px 8px;
  1014. font-size: 0.8em;
  1015. cursor: pointer;
  1016. transition: all 0.2s ease;
  1017. }
  1018. .copy-button:hover {
  1019. background: #404040;
  1020. }
  1021. .copy-button svg {
  1022. width: 14px;
  1023. height: 14px;
  1024. margin-right: 4px;
  1025. }
  1026. .tooltip {
  1027. position: absolute;
  1028. top: -30px;
  1029. left: 50%;
  1030. transform: translateX(-50%);
  1031. background: black;
  1032. color: white;
  1033. padding: 4px 8px;
  1034. border-radius: 4px;
  1035. font-size: 12px;
  1036. display: none;
  1037. }
  1038. .tooltip::after {
  1039. content: "";
  1040. position: absolute;
  1041. top: 100%;
  1042. left: 50%;
  1043. transform: translateX(-50%);
  1044. border: 5px solid transparent;
  1045. border-top-color: black;
  1046. }
  1047. .copy-button.copied .tooltip {
  1048. display: block;
  1049. }
  1050. </style>
  1051. <div class="code-block-container" data-lang="bash">
  1052. <div class="code-header">
  1053. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1054. <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">
  1055. <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"/>
  1056. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1057. </svg>
  1058. <span>Copy</span>
  1059. <div class="tooltip">Copied!</div>
  1060. </button>
  1061. </div>
  1062. <div class="code-content">
  1063. <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
  1064. </span></span><span style="display:flex;"><span>sudo mount /home</span></span></code></pre></div>
  1065. </div>
  1066. </div>
  1067. <script>
  1068. function copyCodeBlock(button) {
  1069. const container = button.closest('.code-block-container');
  1070. const codeContent = container.querySelector('.code-content pre');
  1071. const code = codeContent.textContent;
  1072. navigator.clipboard.writeText(code.trim()).then(() => {
  1073. button.classList.add('copied');
  1074. setTimeout(() => {
  1075. button.classList.remove('copied');
  1076. }, 2000);
  1077. }).catch(err => {
  1078. console.error('Failed to copy:', err);
  1079. const textarea = document.createElement('textarea');
  1080. textarea.value = code.trim();
  1081. document.body.appendChild(textarea);
  1082. textarea.select();
  1083. try {
  1084. document.execCommand('copy');
  1085. button.classList.add('copied');
  1086. setTimeout(() => {
  1087. button.classList.remove('copied');
  1088. }, 2000);
  1089. } catch (e) {
  1090. console.error('Fallback failed:', e);
  1091. }
  1092. document.body.removeChild(textarea);
  1093. });
  1094. }
  1095. </script>
  1096. <hr>
  1097. <h2 id="6-verify-and-reboot"><strong>6. Verify and Reboot</strong></h2>
  1098. <p>Check that everything is in place:</p>
  1099. <style>
  1100. .code-block-container {
  1101. position: relative;
  1102. margin: 1em 0;
  1103. }
  1104. .code-header {
  1105. position: absolute;
  1106. top: 8px;
  1107. right: 8px;
  1108. z-index: 999;
  1109. }
  1110. .copy-button {
  1111. display: inline-flex;
  1112. align-items: center;
  1113. background: #2d2d2d;
  1114. color: white;
  1115. border: 1px solid #404040;
  1116. border-radius: 4px;
  1117. padding: 4px 8px;
  1118. font-size: 0.8em;
  1119. cursor: pointer;
  1120. transition: all 0.2s ease;
  1121. }
  1122. .copy-button:hover {
  1123. background: #404040;
  1124. }
  1125. .copy-button svg {
  1126. width: 14px;
  1127. height: 14px;
  1128. margin-right: 4px;
  1129. }
  1130. .tooltip {
  1131. position: absolute;
  1132. top: -30px;
  1133. left: 50%;
  1134. transform: translateX(-50%);
  1135. background: black;
  1136. color: white;
  1137. padding: 4px 8px;
  1138. border-radius: 4px;
  1139. font-size: 12px;
  1140. display: none;
  1141. }
  1142. .tooltip::after {
  1143. content: "";
  1144. position: absolute;
  1145. top: 100%;
  1146. left: 50%;
  1147. transform: translateX(-50%);
  1148. border: 5px solid transparent;
  1149. border-top-color: black;
  1150. }
  1151. .copy-button.copied .tooltip {
  1152. display: block;
  1153. }
  1154. </style>
  1155. <div class="code-block-container" data-lang="bash">
  1156. <div class="code-header">
  1157. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1158. <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">
  1159. <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"/>
  1160. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1161. </svg>
  1162. <span>Copy</span>
  1163. <div class="tooltip">Copied!</div>
  1164. </button>
  1165. </div>
  1166. <div class="code-content">
  1167. <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>
  1168. </div>
  1169. </div>
  1170. <script>
  1171. function copyCodeBlock(button) {
  1172. const container = button.closest('.code-block-container');
  1173. const codeContent = container.querySelector('.code-content pre');
  1174. const code = codeContent.textContent;
  1175. navigator.clipboard.writeText(code.trim()).then(() => {
  1176. button.classList.add('copied');
  1177. setTimeout(() => {
  1178. button.classList.remove('copied');
  1179. }, 2000);
  1180. }).catch(err => {
  1181. console.error('Failed to copy:', err);
  1182. const textarea = document.createElement('textarea');
  1183. textarea.value = code.trim();
  1184. document.body.appendChild(textarea);
  1185. textarea.select();
  1186. try {
  1187. document.execCommand('copy');
  1188. button.classList.add('copied');
  1189. setTimeout(() => {
  1190. button.classList.remove('copied');
  1191. }, 2000);
  1192. } catch (e) {
  1193. console.error('Fallback failed:', e);
  1194. }
  1195. document.body.removeChild(textarea);
  1196. });
  1197. }
  1198. </script>
  1199. <p>If everything looks good, reboot:</p>
  1200. <style>
  1201. .code-block-container {
  1202. position: relative;
  1203. margin: 1em 0;
  1204. }
  1205. .code-header {
  1206. position: absolute;
  1207. top: 8px;
  1208. right: 8px;
  1209. z-index: 999;
  1210. }
  1211. .copy-button {
  1212. display: inline-flex;
  1213. align-items: center;
  1214. background: #2d2d2d;
  1215. color: white;
  1216. border: 1px solid #404040;
  1217. border-radius: 4px;
  1218. padding: 4px 8px;
  1219. font-size: 0.8em;
  1220. cursor: pointer;
  1221. transition: all 0.2s ease;
  1222. }
  1223. .copy-button:hover {
  1224. background: #404040;
  1225. }
  1226. .copy-button svg {
  1227. width: 14px;
  1228. height: 14px;
  1229. margin-right: 4px;
  1230. }
  1231. .tooltip {
  1232. position: absolute;
  1233. top: -30px;
  1234. left: 50%;
  1235. transform: translateX(-50%);
  1236. background: black;
  1237. color: white;
  1238. padding: 4px 8px;
  1239. border-radius: 4px;
  1240. font-size: 12px;
  1241. display: none;
  1242. }
  1243. .tooltip::after {
  1244. content: "";
  1245. position: absolute;
  1246. top: 100%;
  1247. left: 50%;
  1248. transform: translateX(-50%);
  1249. border: 5px solid transparent;
  1250. border-top-color: black;
  1251. }
  1252. .copy-button.copied .tooltip {
  1253. display: block;
  1254. }
  1255. </style>
  1256. <div class="code-block-container" data-lang="bash">
  1257. <div class="code-header">
  1258. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1259. <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">
  1260. <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"/>
  1261. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1262. </svg>
  1263. <span>Copy</span>
  1264. <div class="tooltip">Copied!</div>
  1265. </button>
  1266. </div>
  1267. <div class="code-content">
  1268. <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>
  1269. </div>
  1270. </div>
  1271. <script>
  1272. function copyCodeBlock(button) {
  1273. const container = button.closest('.code-block-container');
  1274. const codeContent = container.querySelector('.code-content pre');
  1275. const code = codeContent.textContent;
  1276. navigator.clipboard.writeText(code.trim()).then(() => {
  1277. button.classList.add('copied');
  1278. setTimeout(() => {
  1279. button.classList.remove('copied');
  1280. }, 2000);
  1281. }).catch(err => {
  1282. console.error('Failed to copy:', err);
  1283. const textarea = document.createElement('textarea');
  1284. textarea.value = code.trim();
  1285. document.body.appendChild(textarea);
  1286. textarea.select();
  1287. try {
  1288. document.execCommand('copy');
  1289. button.classList.add('copied');
  1290. setTimeout(() => {
  1291. button.classList.remove('copied');
  1292. }, 2000);
  1293. } catch (e) {
  1294. console.error('Fallback failed:', e);
  1295. }
  1296. document.body.removeChild(textarea);
  1297. });
  1298. }
  1299. </script>
  1300. <hr>
  1301. <h1 id="things-to-keep-in-mind">Things to Keep in Mind</h1>
  1302. <ul>
  1303. <li>
  1304. <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>
  1305. </li>
  1306. <li>
  1307. <p>If you face permission issues, you might need to reapply ownership:</p>
  1308. </li>
  1309. </ul>
  1310. <style>
  1311. .code-block-container {
  1312. position: relative;
  1313. margin: 1em 0;
  1314. }
  1315. .code-header {
  1316. position: absolute;
  1317. top: 8px;
  1318. right: 8px;
  1319. z-index: 999;
  1320. }
  1321. .copy-button {
  1322. display: inline-flex;
  1323. align-items: center;
  1324. background: #2d2d2d;
  1325. color: white;
  1326. border: 1px solid #404040;
  1327. border-radius: 4px;
  1328. padding: 4px 8px;
  1329. font-size: 0.8em;
  1330. cursor: pointer;
  1331. transition: all 0.2s ease;
  1332. }
  1333. .copy-button:hover {
  1334. background: #404040;
  1335. }
  1336. .copy-button svg {
  1337. width: 14px;
  1338. height: 14px;
  1339. margin-right: 4px;
  1340. }
  1341. .tooltip {
  1342. position: absolute;
  1343. top: -30px;
  1344. left: 50%;
  1345. transform: translateX(-50%);
  1346. background: black;
  1347. color: white;
  1348. padding: 4px 8px;
  1349. border-radius: 4px;
  1350. font-size: 12px;
  1351. display: none;
  1352. }
  1353. .tooltip::after {
  1354. content: "";
  1355. position: absolute;
  1356. top: 100%;
  1357. left: 50%;
  1358. transform: translateX(-50%);
  1359. border: 5px solid transparent;
  1360. border-top-color: black;
  1361. }
  1362. .copy-button.copied .tooltip {
  1363. display: block;
  1364. }
  1365. </style>
  1366. <div class="code-block-container" data-lang="bash">
  1367. <div class="code-header">
  1368. <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
  1369. <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">
  1370. <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"/>
  1371. <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
  1372. </svg>
  1373. <span>Copy</span>
  1374. <div class="tooltip">Copied!</div>
  1375. </button>
  1376. </div>
  1377. <div class="code-content">
  1378. <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>
  1379. </div>
  1380. </div>
  1381. <script>
  1382. function copyCodeBlock(button) {
  1383. const container = button.closest('.code-block-container');
  1384. const codeContent = container.querySelector('.code-content pre');
  1385. const code = codeContent.textContent;
  1386. navigator.clipboard.writeText(code.trim()).then(() => {
  1387. button.classList.add('copied');
  1388. setTimeout(() => {
  1389. button.classList.remove('copied');
  1390. }, 2000);
  1391. }).catch(err => {
  1392. console.error('Failed to copy:', err);
  1393. const textarea = document.createElement('textarea');
  1394. textarea.value = code.trim();
  1395. document.body.appendChild(textarea);
  1396. textarea.select();
  1397. try {
  1398. document.execCommand('copy');
  1399. button.classList.add('copied');
  1400. setTimeout(() => {
  1401. button.classList.remove('copied');
  1402. }, 2000);
  1403. } catch (e) {
  1404. console.error('Fallback failed:', e);
  1405. }
  1406. document.body.removeChild(textarea);
  1407. });
  1408. }
  1409. </script>
  1410. </div>
  1411. </div>
  1412. </main>
  1413. </div>
  1414. <footer class="footer">
  1415. <span>CC 2024, Built with <a href="https://gohugo.io" class="footerLink">Hugo</a> and <a href="https://github.com/LordMathis/hugo-theme-nightfall" class="footerLink">Nightfall</a> theme</span>
  1416. </footer>
  1417. </div>
  1418. </body>
  1419. </html>