GET https://kbin.spritesserver.nl/m/linux@lemmy.ml/t/9460/BTRFS-and-moving-home-to-subvolume-in-need-of-a/votes/up

Security

Token

There is no security token.

Firewall

main Name
Security enabled
Stateless

Configuration

Key Value
provider security.user.provider.concrete.app_user_provider
context main
entry_point App\Security\KbinAuthenticator
user_checker App\Security\UserChecker
access_denied_handler (none)
access_denied_url (none)
authenticators
[
  "two_factor"
  "remember_me"
  "App\Security\KbinAuthenticator"
  "App\Security\FacebookAuthenticator"
  "App\Security\GoogleAuthenticator"
  "App\Security\GithubAuthenticator"
  "App\Security\KeycloakAuthenticator"
]

Listeners

Listener Duration Response
Symfony\Component\Security\Http\Firewall\ChannelListener {#723
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
  -logger: Monolog\Logger {#783 …}
  -httpPort: 80
  -httpsPort: 443
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\ContextListener {#706
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage {#1017 …}
  -sessionKey: "_security_main"
  -logger: Monolog\Logger {#783 …}
  -userProviders: Symfony\Component\DependencyInjection\Argument\RewindableGenerator {#705 …}
  -dispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
  -registered: false
  -trustResolver: Scheb\TwoFactorBundle\Security\Authentication\AuthenticationTrustResolver {#780 …}
  -sessionTrackerEnabler: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage::enableUsageTracking(): void {#703 …}
}
0.15 ms (none)
Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener {#584
  -authenticatorManager: Symfony\Component\Security\Http\Authentication\AuthenticatorManager {#595 …}
}
0.00 ms (none)
Scheb\TwoFactorBundle\Security\Http\Firewall\TwoFactorAccessListener {#582
  -twoFactorFirewallConfig: Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig {#842 …}
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -twoFactorAccessDecider: Scheb\TwoFactorBundle\Security\Authorization\TwoFactorAccessDecider {#581 …}
}
0.04 ms (none)
Symfony\Component\Security\Http\Firewall\AccessListener {#579
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -accessDecisionManager: Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager {#937 …}
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\LogoutListener {#786
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -options: [
    "csrf_parameter" => "_csrf_token"
    "csrf_token_id" => "logout"
    "logout_path" => "app_logout"
  ]
  -httpUtils: Symfony\Component\Security\Http\HttpUtils {#841 …}
  -csrfTokenManager: Symfony\Component\Security\Csrf\CsrfTokenManager {#1015 …}
  -eventDispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
}
0.00 ms (none)

Authenticators

No authenticators have been recorded. Check previous profiles on your authentication endpoint.

Access Decision

affirmative Strategy
# Voter class
1
"Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter"
2
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
3
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
4
"Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter"
5
"App\Security\Voter\EntryCommentVoter"
6
"App\Security\Voter\EntryVoter"
7
"App\Security\Voter\MagazineVoter"
8
"App\Security\Voter\MessageThreadVoter"
9
"App\Security\Voter\MessageVoter"
10
"App\Security\Voter\NotificationVoter"
11
"App\Security\Voter\OAuth2UserConsentVoter"
12
"App\Security\Voter\PostCommentVoter"
13
"App\Security\Voter\PostVoter"
14
"App\Security\Voter\UserVoter"

Access decision log

# Result Attributes Object
1 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
2 DENIED moderate
App\Entity\Entry {#1846
  +user: Proxies\__CG__\App\Entity\User {#1899 …}
  +magazine: App\Entity\Magazine {#289
    +icon: Proxies\__CG__\App\Entity\Image {#270 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#299
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#261 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#257 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#246 …}
    +entries: Doctrine\ORM\PersistentCollection {#204 …}
    +posts: Doctrine\ORM\PersistentCollection {#162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#224 …}
    +bans: Doctrine\ORM\PersistentCollection {#141 …}
    +reports: Doctrine\ORM\PersistentCollection {#127 …}
    +badges: Doctrine\ORM\PersistentCollection {#105 …}
    +logs: Doctrine\ORM\PersistentCollection {#95 …}
    +awards: Doctrine\ORM\PersistentCollection {#84 …}
    +categories: Doctrine\ORM\PersistentCollection {#71 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#293
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#292
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1911 …}
  +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 {#1861
    date: 2023-10-30 12:26:14.0 +01:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1949 …}
  +votes: Doctrine\ORM\PersistentCollection {#1894 …}
  +reports: Doctrine\ORM\PersistentCollection {#2402 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1386 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1370 …}
  +badges: Doctrine\ORM\PersistentCollection {#1375 …}
  +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 {#75
    date: 2023-10-30 12:26:14.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
3 DENIED edit
App\Entity\Entry {#1846
  +user: Proxies\__CG__\App\Entity\User {#1899 …}
  +magazine: App\Entity\Magazine {#289
    +icon: Proxies\__CG__\App\Entity\Image {#270 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#299
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#261 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#257 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#246 …}
    +entries: Doctrine\ORM\PersistentCollection {#204 …}
    +posts: Doctrine\ORM\PersistentCollection {#162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#224 …}
    +bans: Doctrine\ORM\PersistentCollection {#141 …}
    +reports: Doctrine\ORM\PersistentCollection {#127 …}
    +badges: Doctrine\ORM\PersistentCollection {#105 …}
    +logs: Doctrine\ORM\PersistentCollection {#95 …}
    +awards: Doctrine\ORM\PersistentCollection {#84 …}
    +categories: Doctrine\ORM\PersistentCollection {#71 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#293
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#292
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1911 …}
  +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 {#1861
    date: 2023-10-30 12:26:14.0 +01:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1949 …}
  +votes: Doctrine\ORM\PersistentCollection {#1894 …}
  +reports: Doctrine\ORM\PersistentCollection {#2402 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1386 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1370 …}
  +badges: Doctrine\ORM\PersistentCollection {#1375 …}
  +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 {#75
    date: 2023-10-30 12:26:14.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
4 DENIED moderate
App\Entity\Entry {#1846
  +user: Proxies\__CG__\App\Entity\User {#1899 …}
  +magazine: App\Entity\Magazine {#289
    +icon: Proxies\__CG__\App\Entity\Image {#270 …}
    +name: "linux@lemmy.ml"
    +title: "linux"
    +description: """
      From Wikipedia, the free encyclopedia\n
      \n
      Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
      \n
      Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
      \n
      ### Rules\n
      \n
      - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
      - No misinformation\n
      - No NSFW content\n
      - No hate speech, bigotry, etc\n
      \n
      ### Related Communities\n
      \n
      - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
      - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
      - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
      - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
      \n
      Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 1406
    +entryCommentCount: 28632
    +postCount: 6
    +postCommentCount: 214
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729583542 {#299
      date: 2024-10-22 09:52:22.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#261 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#257 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#246 …}
    +entries: Doctrine\ORM\PersistentCollection {#204 …}
    +posts: Doctrine\ORM\PersistentCollection {#162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#224 …}
    +bans: Doctrine\ORM\PersistentCollection {#141 …}
    +reports: Doctrine\ORM\PersistentCollection {#127 …}
    +badges: Doctrine\ORM\PersistentCollection {#105 …}
    +logs: Doctrine\ORM\PersistentCollection {#95 …}
    +awards: Doctrine\ORM\PersistentCollection {#84 …}
    +categories: Doctrine\ORM\PersistentCollection {#71 …}
    -id: 73
    +apId: "linux@lemmy.ml"
    +apProfileId: "https://lemmy.ml/c/linux"
    +apPublicUrl: "https://lemmy.ml/c/linux"
    +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "linux"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729583596 {#293
      date: 2024-10-22 09:53:16.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1698929468 {#292
      date: 2023-11-02 13:51:08.0 +01:00
    }
  }
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1911 …}
  +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 {#1861
    date: 2023-10-30 12:26:14.0 +01:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1949 …}
  +votes: Doctrine\ORM\PersistentCollection {#1894 …}
  +reports: Doctrine\ORM\PersistentCollection {#2402 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1386 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1370 …}
  +badges: Doctrine\ORM\PersistentCollection {#1375 …}
  +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 {#75
    date: 2023-10-30 12:26:14.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
5 DENIED edit
App\Entity\Magazine {#289
  +icon: Proxies\__CG__\App\Entity\Image {#270 …}
  +name: "linux@lemmy.ml"
  +title: "linux"
  +description: """
    From Wikipedia, the free encyclopedia\n
    \n
    Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).\n
    \n
    Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.\n
    \n
    ### Rules\n
    \n
    - Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.\n
    - No misinformation\n
    - No NSFW content\n
    - No hate speech, bigotry, etc\n
    \n
    ### Related Communities\n
    \n
    - [!opensource@lemmy.ml](https://lemmy.ml/c/opensource)\n
    - [!libre_culture@lemmy.ml](https://lemmy.ml/c/libre_culture)\n
    - [!technology@lemmy.ml](https://lemmy.ml/c/technology)\n
    - [!libre_hardware@lemmy.ml](https://lemmy.ml/c/libre_hardware)\n
    \n
    Community icon by [Alpár-Etele Méder](https://www.iconfinder.com/pocike), licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/)
    """
  +rules: null
  +subscriptionsCount: 1
  +entryCount: 1406
  +entryCommentCount: 28632
  +postCount: 6
  +postCommentCount: 214
  +isAdult: false
  +customCss: null
  +lastActive: DateTime @1729583542 {#299
    date: 2024-10-22 09:52:22.0 +02:00
  }
  +markedForDeletionAt: null
  +tags: null
  +moderators: Doctrine\ORM\PersistentCollection {#261 …}
  +ownershipRequests: Doctrine\ORM\PersistentCollection {#257 …}
  +moderatorRequests: Doctrine\ORM\PersistentCollection {#246 …}
  +entries: Doctrine\ORM\PersistentCollection {#204 …}
  +posts: Doctrine\ORM\PersistentCollection {#162 …}
  +subscriptions: Doctrine\ORM\PersistentCollection {#224 …}
  +bans: Doctrine\ORM\PersistentCollection {#141 …}
  +reports: Doctrine\ORM\PersistentCollection {#127 …}
  +badges: Doctrine\ORM\PersistentCollection {#105 …}
  +logs: Doctrine\ORM\PersistentCollection {#95 …}
  +awards: Doctrine\ORM\PersistentCollection {#84 …}
  +categories: Doctrine\ORM\PersistentCollection {#71 …}
  -id: 73
  +apId: "linux@lemmy.ml"
  +apProfileId: "https://lemmy.ml/c/linux"
  +apPublicUrl: "https://lemmy.ml/c/linux"
  +apFollowersUrl: "https://lemmy.ml/c/linux/followers"
  +apInboxUrl: "https://lemmy.ml/inbox"
  +apDomain: "lemmy.ml"
  +apPreferredUsername: "linux"
  +apDiscoverable: true
  +apManuallyApprovesFollowers: null
  +privateKey: null
  +publicKey: null
  +apFetchedAt: DateTime @1729583596 {#293
    date: 2024-10-22 09:53:16.0 +02:00
  }
  +apDeletedAt: null
  +apTimeoutAt: null
  +visibility: "visible             "
  +createdAt: DateTimeImmutable @1698929468 {#292
    date: 2023-11-02 13:51:08.0 +01:00
  }
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS DENIED
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details