You are not logged in.
Hi guys, today I buy a Kingston SSD 120gb to mount on M.2 connector Now my problem is how to set partition scheme with btrfs to have on SSD: root, boot,home and on HDD: var,tmp,media-data. I seen on btrfs wiki that that with btrfs its possible use a single btrfs file system with multiple devices, but I don't understand how to associate different subvolumes with different devices.
Last edited by pepib (2014-11-13 18:45:49)
Offline
You cannot assign a subvolume to a different hdd. You could however create one filesystem on the ssd; and one on the hdd. Create subvolumes without those filesystems and everything should work fine
Offline
but there is others solutions insteand of btrfs for example raid. or the best solution is the following:
SSD:
/root ext4
/boot fat32 (efi)
/home ext4
HDD:
/var/lib ext4
/opt ext4
/media/data ext4
Offline
What is your question? You start this topic with btrfs and then switch back to ext4, why?
Offline
sorry for my ignorance and confusion. return to btrfs I don't understand how to do that you said. The following procedure is correct?
/dev/sda1 is on SDD
/dev/sdb1 is on HDD
mkfs.btrf /dev/sda1
mkfs.btrf /dev/sdb1
mkdir /mnt/btrfs-root
mount -o defaults,relatime,discard,ssd /dev/sda1 /mnt/btrfs-root
mount -o defaults,relatime,discard,ssd /dev/sdb1 /mnt/btrfs-root
mkdir -p /mnt/btrfs-root/__snapshot
mkdir -p /mnt/btrfs-root/__current
btrfs subvolume create /mnt/btrfs-root/__current/ROOT
btrfs subvolume create /mnt/btrfs-root/__current/home
btrfs subvolume create /mnt/btrfs-root/__current/opt
btrfs subvolume create /mnt/btrfs-root/__current/var
mkdir -p /mnt/btrfs-current
mount -o defaults,relatime,discard,ssd,nodev,subvol=__current/ROOT /dev/sda1 /mnt/btrfs-current
mount -o defaults,relatime,discard,ssd,nodev,nosuid,subvol=__current/home /dev/sda1 /mnt/btrfs-current/home
mount -o defaults,relatime,discard,ssd,nodev,nosuid,subvol=__current/opt /dev/sdb1 /mnt/btrfs-current/opt
mount -o defaults,relatime,discard,ssd,nodev,nosuid,noexec,subvol=__current/var /dev/sdb1 /mnt/btrfs-current/var
mkdir -p /mnt/btrfs-current/var/lib
mount --bind /mnt/btrfs-root/__current/ROOT/var/lib /mnt/btrfs-current/var/lib
Offline
Okay; first of all you're mounting both filesystems on top of each other (your first two mount commands); that makes no sense. If I were you; I'd skip the snapshots for now; it should be as simple as:
mkfs.btrfs /dev/sda1
mkfs.btrfs /dev/sdb1
mkdir /mnt/btrfs-root /mnt/btrfs-hdd
mount -o defaults,discard,ssd /dev/sda1 /mnt/btrfs-root
# any subvolumes created here are available as normal directories and don't need to be mounted separately!
btrfs subvolume create /mnt/btrfs-root/home
btrfs subvolume create /mnt/btrfs-root/opt
mount -o defaults /dev/sdb1 /mnt/btrfs-hdd
btrfs subvolume create /mnt/btrfs-hdd/var
btrfs subvolume create /mnt/btrfs-hdd/media
umount /mnt/btrfs-hdd
mount -o defaults,relatime,nodev,subvol=var /dev/sdb1 /mnt/btrfs-root/var
mount -o defaults,relatime,nodev,subvol=media /dev/sdb1 /mnt/btrfs-root/media
This will setup 2 filesystems (one on sda1 and the other on sdb1) with 3 subvolumes with /var and /media residing on sdb1. Does this get you anywhere?
Offline
ok, finally someone which understand me. I had many questions related to if my concept is correct and in theoretically is correct way to set a combination SSD+HDD. Thank you so much.
Offline
Okay, great; I hope it'll work out for you! Can you mark this topic as [solved]?
Offline