You are not logged in.

#1 2014-11-11 10:54:29

pepib
Member
Registered: 2014-07-13
Posts: 23

[SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#2 2014-11-11 12:25:49

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#3 2014-11-11 12:32:18

pepib
Member
Registered: 2014-07-13
Posts: 23

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#4 2014-11-11 12:43:11

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

What is your question? You start this topic with btrfs and then switch back to ext4, why?

Offline

#5 2014-11-11 13:03:07

pepib
Member
Registered: 2014-07-13
Posts: 23

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#6 2014-11-13 17:39:04

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#7 2014-11-13 18:01:14

pepib
Member
Registered: 2014-07-13
Posts: 23

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

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

#8 2014-11-13 18:43:02

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] Btrfs partition scheme with SSD+HDD combination

Okay, great; I hope it'll work out for you! Can you mark this topic as [solved]? smile

Offline

Board footer

Powered by FluxBB