Last active
August 29, 2015 14:16
-
-
Save rumkin/4d22178f4dee9a0ed971 to your computer and use it in GitHub Desktop.
Create btrfs partition from file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Partition file | |
FILE=/tmp/drive | |
# Mount directory | |
MOUNT=/mnt/drive | |
# Allocate 10Gb empty file | |
fallocate -l 10G $FILE | |
# Mount file to loop back device | |
losetup /dev/loop0 | |
# Create btrfs _without RAID_ | |
mkfs.btrfs -m single /dev/loop0 | |
# Create mount point | |
mkdir $MOUNT | |
# mount file to mount point | |
mount -t btrfs $MOUNT $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment