Btrfs: Difference between revisions
m →Usage: Copyedit incl combine short paras |
m →Convert Ext3/Ext4 system partition to Btrfs: Missing small words etc |
||
| Line 285: | Line 285: | ||
</div> | </div> | ||
To convert the existing filesystem (Ext3/4) to Btrfs, boot into a NixOS live system and run following | To convert the existing filesystem (Ext3/4) to Btrfs, boot into a NixOS live system and run the following commandː<syntaxhighlight lang="sh"> | ||
fsck -f /dev/sdXY | fsck -f /dev/sdXY | ||
btrfs-convert /dev/sdXY | btrfs-convert /dev/sdXY | ||
</syntaxhighlight>Replace the device path with the target partition. Converting larger filesystems can take a long time. | </syntaxhighlight>Replace the device path with the target partition. Converting larger filesystems can take a long time. | ||
Next, mount the converted filesystem and chroot into | Next, mount the converted filesystem and chroot into itː<syntaxhighlight lang="sh"> | ||
mount /dev/sdXY /mnt | mount /dev/sdXY /mnt | ||
nixos-enter --root /mnt | nixos-enter --root /mnt | ||
| Line 301: | Line 301: | ||
</syntaxhighlight>Apply the changes<syntaxhighlight lang="sh"> | </syntaxhighlight>Apply the changes<syntaxhighlight lang="sh"> | ||
nixos-rebuild boot | nixos-rebuild boot | ||
</syntaxhighlight> | </syntaxhighlight>If the Grub bootloader is used and it doesn't get reinstalled correctly, you can run the following command inside chrootː<syntaxhighlight lang="sh"> | ||
grub-install /dev/sdX | grub-install /dev/sdX | ||
</syntaxhighlight>If the conversion | </syntaxhighlight>If the conversion was successful and no rollback is required, the backup image which was stored by btrfs-convert can be removed withː<syntaxhighlight lang="sh"> | ||
btrfs subvolume delete /btrfs/ext2_saved | btrfs subvolume delete /btrfs/ext2_saved | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category: Configuration]] | [[Category: Configuration]] | ||
[[Category:Filesystem]] | [[Category:Filesystem]] | ||