2 |
DENIED
|
moderate
|
App\Entity\Entry {#1573
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1617 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1596 …}
+slug: "BTRFS-and-moving-home-to-subvolume-in-need-of-a"
+title: "BTRFS and moving /home to subvolume, in need of a sanity check."
+url: null
+body: """
So I installed Debian 12 with btrfs and apparently it only uses a single subvolume `rootfs`. I would like to have my `/home` in a separate subvolume (and possibly `/var` too I guess) and with a flat subvolume structure. I started figuring out on how to do it and I feel like I’m not entirely sure yet so I need a sanity check.\n
\n
Lots of comments online seem to use something like this method:\n
\n
```\n
\n
<span style="color:#323232;">cd /\n
</span><span style="color:#323232;">mv /home /home_old\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;">cp -a --reflink=always /home_old/* /home/\n
</span>\n
```\n
\n
But this would NOT create a flat subvolume structure, right? And you woul NOT need to modify `fstab` as the `/home` would be automatically mounted because it resides under `rootfs` actually because `/` is `rootfs` and not its parent?\n
\n
If I want to actually have a flat structure, then I would first need to mount the actual parent subvolume (subvolumeid=5), cd into it, then create the `home` subvolume, copy everything from the current `home` directory into there, unmount, modify `fstab` to mount `home`, and delete the old stuff and reboot I guess.\n
\n
Soo something like this:\n
\n
```\n
\n
<span style="color:#323232;">mkdir /mnt/tmp\n
</span><span style="color:#323232;"> Make a folder for mount\n
</span><span style="color:#323232;">mount -o subvolid=5 /dev/sdXX /mnt/tmp/\n
</span><span style="color:#323232;"> Mount the actual parent subvolume\n
</span><span style="color:#323232;">cd /mnt/tmp/\n
</span><span style="color:#323232;"> Here 'ls -a' would output 'rootfs' if I understood correctly\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;"> Create new subvolume, now being sibling of 'rootfs'\n
</span><span style="color:#323232;">cp -a --reflink=always /home/* /mnt/tmp/home/\n
</span><span style="color:#323232;"> Copy old /home\n
</span><span style="color:#323232;">umount /mnt/tmp/\n
</span><span style="color:#323232;"> Don't need it anymore \n
</span>\n
```\n
\n
Then go to `fstab`, and do something like\n
\n
```\n
\n
<span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">-> change into\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">UUID= /home btrfs subvol=home bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span>\n
```\n
\n
Then just `rm -rf /home/*` (or just move to keep it as backup if something is fucked up) and reboot?\n
\n
Does this sound about right?\n
\n
Edit:\n
\n
Everything went smoothly. Well just don’t fuck up fstab like I did. Decided not to make `/var` into a subvolume because not sure if you can do it the same way, thinking that logs etc are being written all the time so the gap between me copying everything to the subvolume, and eventually booting might make weird things but dunno. Also added `compress=zstd` into `fstab` mount options to reduce writes on the ssd.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 0
+favouriteCount: 1
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1698665174 {#1572
date: 2023-10-30 12:26:14.0 +01:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1619 …}
+votes: Doctrine\ORM\PersistentCollection {#1701 …}
+reports: Doctrine\ORM\PersistentCollection {#1680 …}
+favourites: Doctrine\ORM\PersistentCollection {#1729 …}
+notifications: Doctrine\ORM\PersistentCollection {#1732 …}
+badges: Doctrine\ORM\PersistentCollection {#2465 …}
+children: []
-id: 9460
-titleTs: "'/home':4 'btrfs':1 'check':12 'move':3 'need':8 'saniti':11 'subvolum':6"
-bodyTs: "'/dev/sdxx':197 '/home':23,78,89,110,232,236,273,286 '/home_old':79,88 '/mnt/tmp':187,198,205,238 '/mnt/tmp/home':233 '/var':30,325 '12':5 '5':149,196 'actual':120,132,145,201 'ad':370 'also':369 'alway':87,231 'anymor':243 'appar':9 'automat':113 'backup':294 'boot':362 'btrfs':7,80,216,253,264,274 'bunch':256,267,277 'cd':76,150,204 'chang':261 'check':64 'comment':67 'compress':371 'copi':158,234,355 'correct':215 'cp':84,228 'creat':82,94,154,218,220 'current':162 'debian':4 'decid':321 'delet':174 'directori':164 'dunno':368 'edit':307 'entir':56 'etc':343 'eventu':361 'everyth':159,308,356 'feel':51 'figur':42 'first':140 'flat':37,96,135 'folder':190 'fstab':107,169,247,317,374 'fuck':298,315 'gap':352 'go':245 'guess':33,181 'home':83,156,163,172,219,276 'instal':3 'keep':291 'like':19,52,73,184,251,318 'log':342 'lot':65 'ls':207 'm':54 'make':188,324,364 'method':75 'might':363 'mkdir':186 'modifi':106,168 'mount':114,143,171,192,193,199,375 'move':289 'mv':77 'need':61,104,141,241 'new':221 'o':194 'old':176,235 'onlin':68 'option':258,269,279,376 'output':210 'parent':127,146,202 'possibl':29 'reboot':179,301 'reduc':378 'reflink':86,230 'resid':117 'rf':285 'right':99,306 'rm':284 'rootf':16,119,123,211,227,255,266 'saniti':63 'seem':69 'separ':26 'sibl':225 'singl':14 'smooth':310 'someth':72,183,250,296 'soo':182 'sound':304 'ssd':382 'start':41 'structur':39,98,136 'stuff':177,260,271,281 'subvol':254,265,275 'subvolid':195 'subvolum':15,27,38,81,97,147,157,203,217,222,328,359 'subvolumeid':148 'sure':57,331 'thing':366 'think':340 'time':349 'umount':237 'understood':214 'unmount':167 'use':12,71 'uuid':252,263,272 'want':130 'way':339 'weird':365 'well':311 'went':309 'woul':102 'would':18,92,111,139,209 'write':379 'written':346 'yet':58 'zstd':372"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1698665174
+visibility: "visible "
+apId: "https://sopuli.xyz/post/5276014"
+editedAt: null
+createdAt: DateTimeImmutable @1698665174 {#1660
date: 2023-10-30 12:26:14.0 +01:00
}
} |
3 |
DENIED
|
edit
|
App\Entity\Entry {#1573
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1617 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1596 …}
+slug: "BTRFS-and-moving-home-to-subvolume-in-need-of-a"
+title: "BTRFS and moving /home to subvolume, in need of a sanity check."
+url: null
+body: """
So I installed Debian 12 with btrfs and apparently it only uses a single subvolume `rootfs`. I would like to have my `/home` in a separate subvolume (and possibly `/var` too I guess) and with a flat subvolume structure. I started figuring out on how to do it and I feel like I’m not entirely sure yet so I need a sanity check.\n
\n
Lots of comments online seem to use something like this method:\n
\n
```\n
\n
<span style="color:#323232;">cd /\n
</span><span style="color:#323232;">mv /home /home_old\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;">cp -a --reflink=always /home_old/* /home/\n
</span>\n
```\n
\n
But this would NOT create a flat subvolume structure, right? And you woul NOT need to modify `fstab` as the `/home` would be automatically mounted because it resides under `rootfs` actually because `/` is `rootfs` and not its parent?\n
\n
If I want to actually have a flat structure, then I would first need to mount the actual parent subvolume (subvolumeid=5), cd into it, then create the `home` subvolume, copy everything from the current `home` directory into there, unmount, modify `fstab` to mount `home`, and delete the old stuff and reboot I guess.\n
\n
Soo something like this:\n
\n
```\n
\n
<span style="color:#323232;">mkdir /mnt/tmp\n
</span><span style="color:#323232;"> Make a folder for mount\n
</span><span style="color:#323232;">mount -o subvolid=5 /dev/sdXX /mnt/tmp/\n
</span><span style="color:#323232;"> Mount the actual parent subvolume\n
</span><span style="color:#323232;">cd /mnt/tmp/\n
</span><span style="color:#323232;"> Here 'ls -a' would output 'rootfs' if I understood correctly\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;"> Create new subvolume, now being sibling of 'rootfs'\n
</span><span style="color:#323232;">cp -a --reflink=always /home/* /mnt/tmp/home/\n
</span><span style="color:#323232;"> Copy old /home\n
</span><span style="color:#323232;">umount /mnt/tmp/\n
</span><span style="color:#323232;"> Don't need it anymore \n
</span>\n
```\n
\n
Then go to `fstab`, and do something like\n
\n
```\n
\n
<span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">-> change into\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">UUID= /home btrfs subvol=home bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span>\n
```\n
\n
Then just `rm -rf /home/*` (or just move to keep it as backup if something is fucked up) and reboot?\n
\n
Does this sound about right?\n
\n
Edit:\n
\n
Everything went smoothly. Well just don’t fuck up fstab like I did. Decided not to make `/var` into a subvolume because not sure if you can do it the same way, thinking that logs etc are being written all the time so the gap between me copying everything to the subvolume, and eventually booting might make weird things but dunno. Also added `compress=zstd` into `fstab` mount options to reduce writes on the ssd.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 0
+favouriteCount: 1
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1698665174 {#1572
date: 2023-10-30 12:26:14.0 +01:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1619 …}
+votes: Doctrine\ORM\PersistentCollection {#1701 …}
+reports: Doctrine\ORM\PersistentCollection {#1680 …}
+favourites: Doctrine\ORM\PersistentCollection {#1729 …}
+notifications: Doctrine\ORM\PersistentCollection {#1732 …}
+badges: Doctrine\ORM\PersistentCollection {#2465 …}
+children: []
-id: 9460
-titleTs: "'/home':4 'btrfs':1 'check':12 'move':3 'need':8 'saniti':11 'subvolum':6"
-bodyTs: "'/dev/sdxx':197 '/home':23,78,89,110,232,236,273,286 '/home_old':79,88 '/mnt/tmp':187,198,205,238 '/mnt/tmp/home':233 '/var':30,325 '12':5 '5':149,196 'actual':120,132,145,201 'ad':370 'also':369 'alway':87,231 'anymor':243 'appar':9 'automat':113 'backup':294 'boot':362 'btrfs':7,80,216,253,264,274 'bunch':256,267,277 'cd':76,150,204 'chang':261 'check':64 'comment':67 'compress':371 'copi':158,234,355 'correct':215 'cp':84,228 'creat':82,94,154,218,220 'current':162 'debian':4 'decid':321 'delet':174 'directori':164 'dunno':368 'edit':307 'entir':56 'etc':343 'eventu':361 'everyth':159,308,356 'feel':51 'figur':42 'first':140 'flat':37,96,135 'folder':190 'fstab':107,169,247,317,374 'fuck':298,315 'gap':352 'go':245 'guess':33,181 'home':83,156,163,172,219,276 'instal':3 'keep':291 'like':19,52,73,184,251,318 'log':342 'lot':65 'ls':207 'm':54 'make':188,324,364 'method':75 'might':363 'mkdir':186 'modifi':106,168 'mount':114,143,171,192,193,199,375 'move':289 'mv':77 'need':61,104,141,241 'new':221 'o':194 'old':176,235 'onlin':68 'option':258,269,279,376 'output':210 'parent':127,146,202 'possibl':29 'reboot':179,301 'reduc':378 'reflink':86,230 'resid':117 'rf':285 'right':99,306 'rm':284 'rootf':16,119,123,211,227,255,266 'saniti':63 'seem':69 'separ':26 'sibl':225 'singl':14 'smooth':310 'someth':72,183,250,296 'soo':182 'sound':304 'ssd':382 'start':41 'structur':39,98,136 'stuff':177,260,271,281 'subvol':254,265,275 'subvolid':195 'subvolum':15,27,38,81,97,147,157,203,217,222,328,359 'subvolumeid':148 'sure':57,331 'thing':366 'think':340 'time':349 'umount':237 'understood':214 'unmount':167 'use':12,71 'uuid':252,263,272 'want':130 'way':339 'weird':365 'well':311 'went':309 'woul':102 'would':18,92,111,139,209 'write':379 'written':346 'yet':58 'zstd':372"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1698665174
+visibility: "visible "
+apId: "https://sopuli.xyz/post/5276014"
+editedAt: null
+createdAt: DateTimeImmutable @1698665174 {#1660
date: 2023-10-30 12:26:14.0 +01:00
}
} |
4 |
DENIED
|
moderate
|
App\Entity\Entry {#1573
+user: App\Entity\User {#265 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1617 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#1596 …}
+slug: "BTRFS-and-moving-home-to-subvolume-in-need-of-a"
+title: "BTRFS and moving /home to subvolume, in need of a sanity check."
+url: null
+body: """
So I installed Debian 12 with btrfs and apparently it only uses a single subvolume `rootfs`. I would like to have my `/home` in a separate subvolume (and possibly `/var` too I guess) and with a flat subvolume structure. I started figuring out on how to do it and I feel like I’m not entirely sure yet so I need a sanity check.\n
\n
Lots of comments online seem to use something like this method:\n
\n
```\n
\n
<span style="color:#323232;">cd /\n
</span><span style="color:#323232;">mv /home /home_old\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;">cp -a --reflink=always /home_old/* /home/\n
</span>\n
```\n
\n
But this would NOT create a flat subvolume structure, right? And you woul NOT need to modify `fstab` as the `/home` would be automatically mounted because it resides under `rootfs` actually because `/` is `rootfs` and not its parent?\n
\n
If I want to actually have a flat structure, then I would first need to mount the actual parent subvolume (subvolumeid=5), cd into it, then create the `home` subvolume, copy everything from the current `home` directory into there, unmount, modify `fstab` to mount `home`, and delete the old stuff and reboot I guess.\n
\n
Soo something like this:\n
\n
```\n
\n
<span style="color:#323232;">mkdir /mnt/tmp\n
</span><span style="color:#323232;"> Make a folder for mount\n
</span><span style="color:#323232;">mount -o subvolid=5 /dev/sdXX /mnt/tmp/\n
</span><span style="color:#323232;"> Mount the actual parent subvolume\n
</span><span style="color:#323232;">cd /mnt/tmp/\n
</span><span style="color:#323232;"> Here 'ls -a' would output 'rootfs' if I understood correctly\n
</span><span style="color:#323232;">btrfs subvolume create home\n
</span><span style="color:#323232;"> Create new subvolume, now being sibling of 'rootfs'\n
</span><span style="color:#323232;">cp -a --reflink=always /home/* /mnt/tmp/home/\n
</span><span style="color:#323232;"> Copy old /home\n
</span><span style="color:#323232;">umount /mnt/tmp/\n
</span><span style="color:#323232;"> Don't need it anymore \n
</span>\n
```\n
\n
Then go to `fstab`, and do something like\n
\n
```\n
\n
<span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">-> change into\n
</span><span style="color:#323232;">...\n
</span><span style="color:#323232;">UUID= / btrfs subvol=rootfs bunch_of_options_and_stuff\n
</span><span style="color:#323232;">UUID= /home btrfs subvol=home bunch_of_options_and_stuff\n
</span><span style="color:#323232;">...\n
</span>\n
```\n
\n
Then just `rm -rf /home/*` (or just move to keep it as backup if something is fucked up) and reboot?\n
\n
Does this sound about right?\n
\n
Edit:\n
\n
Everything went smoothly. Well just don’t fuck up fstab like I did. Decided not to make `/var` into a subvolume because not sure if you can do it the same way, thinking that logs etc are being written all the time so the gap between me copying everything to the subvolume, and eventually booting might make weird things but dunno. Also added `compress=zstd` into `fstab` mount options to reduce writes on the ssd.
"""
+type: "article"
+lang: "en"
+isOc: false
+hasEmbed: false
+commentCount: 0
+favouriteCount: 1
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1698665174 {#1572
date: 2023-10-30 12:26:14.0 +01:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1619 …}
+votes: Doctrine\ORM\PersistentCollection {#1701 …}
+reports: Doctrine\ORM\PersistentCollection {#1680 …}
+favourites: Doctrine\ORM\PersistentCollection {#1729 …}
+notifications: Doctrine\ORM\PersistentCollection {#1732 …}
+badges: Doctrine\ORM\PersistentCollection {#2465 …}
+children: []
-id: 9460
-titleTs: "'/home':4 'btrfs':1 'check':12 'move':3 'need':8 'saniti':11 'subvolum':6"
-bodyTs: "'/dev/sdxx':197 '/home':23,78,89,110,232,236,273,286 '/home_old':79,88 '/mnt/tmp':187,198,205,238 '/mnt/tmp/home':233 '/var':30,325 '12':5 '5':149,196 'actual':120,132,145,201 'ad':370 'also':369 'alway':87,231 'anymor':243 'appar':9 'automat':113 'backup':294 'boot':362 'btrfs':7,80,216,253,264,274 'bunch':256,267,277 'cd':76,150,204 'chang':261 'check':64 'comment':67 'compress':371 'copi':158,234,355 'correct':215 'cp':84,228 'creat':82,94,154,218,220 'current':162 'debian':4 'decid':321 'delet':174 'directori':164 'dunno':368 'edit':307 'entir':56 'etc':343 'eventu':361 'everyth':159,308,356 'feel':51 'figur':42 'first':140 'flat':37,96,135 'folder':190 'fstab':107,169,247,317,374 'fuck':298,315 'gap':352 'go':245 'guess':33,181 'home':83,156,163,172,219,276 'instal':3 'keep':291 'like':19,52,73,184,251,318 'log':342 'lot':65 'ls':207 'm':54 'make':188,324,364 'method':75 'might':363 'mkdir':186 'modifi':106,168 'mount':114,143,171,192,193,199,375 'move':289 'mv':77 'need':61,104,141,241 'new':221 'o':194 'old':176,235 'onlin':68 'option':258,269,279,376 'output':210 'parent':127,146,202 'possibl':29 'reboot':179,301 'reduc':378 'reflink':86,230 'resid':117 'rf':285 'right':99,306 'rm':284 'rootf':16,119,123,211,227,255,266 'saniti':63 'seem':69 'separ':26 'sibl':225 'singl':14 'smooth':310 'someth':72,183,250,296 'soo':182 'sound':304 'ssd':382 'start':41 'structur':39,98,136 'stuff':177,260,271,281 'subvol':254,265,275 'subvolid':195 'subvolum':15,27,38,81,97,147,157,203,217,222,328,359 'subvolumeid':148 'sure':57,331 'thing':366 'think':340 'time':349 'umount':237 'understood':214 'unmount':167 'use':12,71 'uuid':252,263,272 'want':130 'way':339 'weird':365 'well':311 'went':309 'woul':102 'would':18,92,111,139,209 'write':379 'written':346 'yet':58 'zstd':372"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1698665174
+visibility: "visible "
+apId: "https://sopuli.xyz/post/5276014"
+editedAt: null
+createdAt: DateTimeImmutable @1698665174 {#1660
date: 2023-10-30 12:26:14.0 +01:00
}
} |