1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618 |
- <!DOCTYPE html>
- <html lang="en-us">
- <head><script src="/livereload.js?mindelay=10&v=2&port=55173&path=livereload" data-no-instant defer></script>
- <title>
- Move /home Folder | codeskraps
- </title>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="Mobile development blog by Carles Sentis, sharing expertise in Android, iOS, and Kotlin Multiplatform development">
- <meta name="generator" content="Hugo 0.145.0">
- <link rel="canonical" href="http://localhost:55173/posts/2025/move_home_folder/" >
- <link href="/css/style.min.ee0d47e4d4346c71a65a9e873108c81ffae54d60a2fc2338f6df394eb4b25a82.css" rel="stylesheet">
- </head>
- <body>
- <div class="flexWrapper">
- <header class="headerWrapper">
- <div class="header">
- <div>
- <a class="terminal" href="http://localhost:55173/">
- <span>me@codeskraps.com ~ $</span>
- </a>
- </div>
- <input class="side-menu" type="checkbox" id="side-menu">
- <label class="hamb" for="side-menu"><span class="hamb-line"></span></label>
- <nav class="headerLinks">
- <ul>
-
- <li>
- <a href="http://localhost:55173/posts/" title="" >
- ~/posts</a>
- </li>
-
- <li>
- <a href="http://localhost:55173/projects/" title="" >
- ~/projects</a>
- </li>
-
- <li>
- <a href="http://localhost:55173/about/" title="" >
- ~/about</a>
- </li>
-
- </ul>
- </nav>
- </divi>
-
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-YP8WK3KZF1"></script>
- <script>
- var doNotTrack = false;
- if ( false ) {
- var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
- var doNotTrack = (dnt == "1" || dnt == "yes");
- }
- if (!doNotTrack) {
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'G-YP8WK3KZF1');
- }
- </script>
- </header>
- <div class="content">
- <main class="main">
-
- <div class="postWrapper">
- <h1>Move /home Folder</h1>
-
-
- <section class="postMetadata">
- <dl>
-
-
- <dt>tags</dt>
- <dd><span></span>
- <a href="/tags/linux/">#Linux</a></dd>
-
-
-
-
- <dt>published</dt>
-
- <dd><time datetime="2025-01-29">January 29, 2025</time></dd>
-
-
- <dt>reading time</dt>
- <dd>2 minutes</dd>
-
- </dl>
- </section>
-
- <div>
- <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>
- <hr>
- <h2 id="1-create-a-backup-recommended"><strong>1. Create a Backup (Recommended)</strong></h2>
- <p>Before proceeding, create a backup of your home folder in case anything goes wrong.</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <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>
- <p>If you’re moving /home to a different partition or disk, make sure it’s properly formatted and mounted.</p>
- <p>For example, if you want to use a new disk (e.g., <code>/dev/sdb1</code>):</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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
- </span></span><span style="display:flex;"><span>sudo mkdir /mnt/newhome
- </span></span><span style="display:flex;"><span>sudo mount /dev/sdb1 /mnt/newhome</span></span></code></pre></div>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <h2 id="3-copy-the-home-folder"><strong>3. Copy the Home Folder</strong></h2>
- <p>Copy all user data to the new location while preserving permissions:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <hr>
- <h2 id="4-update-fstab"><strong>4. Update fstab</strong></h2>
- <p>Edit /etc/fstab to mount the new home directory at boot.</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>Add this line at the end (adjust the path accordingly):</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>If you prefer using the UUID, first find it:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>Then, add this line instead:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="arduino">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <hr>
- <h2 id="5-unmount-old-home-and-mount-new-one"><strong>5. Unmount Old Home and Mount New One</strong></h2>
- <p>Switch to a different session (e.g., TTY):</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>Log in and stop processes using <code>/home</code>:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>Unmount and remount:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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
- </span></span><span style="display:flex;"><span>sudo mount /home</span></span></code></pre></div>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <hr>
- <h2 id="6-verify-and-reboot"><strong>6. Verify and Reboot</strong></h2>
- <p>Check that everything is in place:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <p>If everything looks good, reboot:</p>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- <hr>
- <h1 id="things-to-keep-in-mind">Things to Keep in Mind</h1>
- <ul>
- <li>
- <p>If you’re logged in as a regular user, switch to a root shell (sudo -i) or use a temporary user with administrative privileges.</p>
- </li>
- <li>
- <p>If you face permission issues, you might need to reapply ownership:</p>
- </li>
- </ul>
- <style>
- .code-block-container {
- position: relative;
- margin: 1em 0;
- }
- .code-header {
- position: absolute;
- top: 8px;
- right: 8px;
- z-index: 999;
- }
- .copy-button {
- display: inline-flex;
- align-items: center;
- background: #2d2d2d;
- color: white;
- border: 1px solid #404040;
- border-radius: 4px;
- padding: 4px 8px;
- font-size: 0.8em;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .copy-button:hover {
- background: #404040;
- }
- .copy-button svg {
- width: 14px;
- height: 14px;
- margin-right: 4px;
- }
- .tooltip {
- position: absolute;
- top: -30px;
- left: 50%;
- transform: translateX(-50%);
- background: black;
- color: white;
- padding: 4px 8px;
- border-radius: 4px;
- font-size: 12px;
- display: none;
- }
- .tooltip::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- border: 5px solid transparent;
- border-top-color: black;
- }
- .copy-button.copied .tooltip {
- display: block;
- }
- </style>
- <div class="code-block-container" data-lang="bash">
- <div class="code-header">
- <button class="copy-button" onclick="copyCodeBlock(this)" aria-label="Copy code">
- <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">
- <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"/>
- <path d="M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2"/>
- </svg>
- <span>Copy</span>
- <div class="tooltip">Copied!</div>
- </button>
- </div>
- <div class="code-content">
- <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>
- </div>
- </div>
- <script>
- function copyCodeBlock(button) {
- const container = button.closest('.code-block-container');
- const codeContent = container.querySelector('.code-content pre');
- const code = codeContent.textContent;
-
- navigator.clipboard.writeText(code.trim()).then(() => {
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- }).catch(err => {
- console.error('Failed to copy:', err);
-
- const textarea = document.createElement('textarea');
- textarea.value = code.trim();
- document.body.appendChild(textarea);
- textarea.select();
- try {
- document.execCommand('copy');
- button.classList.add('copied');
- setTimeout(() => {
- button.classList.remove('copied');
- }, 2000);
- } catch (e) {
- console.error('Fallback failed:', e);
- }
- document.body.removeChild(textarea);
- });
- }
- </script>
- </div>
- </div>
- </main>
- </div>
- <footer class="footer">
-
- <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>
-
- </footer>
- </div>
- </body>
- </html>
|