Fails to create ext4 partition

[liveuser@eos-2020.07.15 ~]$ sudo btrfs filesystem show /mnt
Label: none  uuid: 2d127164-f2f7-48a4-9a3e-49e32b1d1109
	Total devices 1 FS bytes used 7.50GiB
	devid    1 size 110.75GiB used 9.02GiB path /dev/sda4

EDIT: Just saw your own edit. When I tried running
btrfs device add /dev/sdb4 /home
it didn’t work properly and got me the following error:

[liveuser@eos-2020.07.15 ~]$ sudo btrfs device add /dev/sdb4 /home
ERROR: not a btrfs filesystem: /home

Do I need to be booted into new system and just flatout ignore the rest of the guide? I’m a little confused.

EDIT 2: It seems like I may have screwed myself. I force-mounted sdb4 and then reformatted as unformatted, as that’s what the guide you just linked called for, and now I think if I go further I’ll break something. I need to figure out how to remove the drive, format it back to btrfs, and go back to following the first guide.

Everything I did

[liveuser@eos-2020.07.15 ~]$ sudo btrfs device add /dev/sdb4 /mnt -f
[liveuser@eos-2020.07.15 ~]$ ls /etc/fstab
/etc/fstab
[liveuser@eos-2020.07.15 ~]$ btrfs filesystem show /mnt
ERROR: cannot open /dev/sda4: Permission denied
ERROR: not a valid btrfs filesystem: /mnt
[liveuser@eos-2020.07.15 ~]$ sudo btrfs filesystem show /mnt
Label: none  uuid: 2d127164-f2f7-48a4-9a3e-49e32b1d1109
	Total devices 2 FS bytes used 7.50GiB
	devid    1 size 110.75GiB used 9.02GiB path /dev/sda4
	devid    2 size 110.75GiB used 0.00B path /dev/sdb4

[liveuser@eos-2020.07.15 ~]$ sudo btrfs device add /dev/sdb4 /home
ERROR: not a btrfs filesystem: /home
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4 /mnt -f
ERROR: cannot access '-f': No such file or directory
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4 /mnt
ERROR: error removing device '/dev/sdb4': Invalid argument
[liveuser@eos-2020.07.15 ~]$ btrfs filesystem show /mnt
ERROR: cannot open /dev/sda4: Permission denied
ERROR: not a valid btrfs filesystem: /mnt
[liveuser@eos-2020.07.15 ~]$ sudo btrfs filesystem show /mnt
Label: none  uuid: 2d127164-f2f7-48a4-9a3e-49e32b1d1109
	Total devices 2 FS bytes used 7.50GiB
	devid    1 size 110.75GiB used 9.02GiB path /dev/sda4
	devid    2 size 110.75GiB used 0.00B path /dev/sdb4

[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4 /mnt
ERROR: error removing device '/dev/sdb4': Invalid argument
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4
btrfs device remove: not enough arguments: 1 but at least 2 expected
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4 /mnt
ERROR: error removing device '/dev/sdb4': Invalid argument
[liveuser@eos-2020.07.15 ~]$ man btrfs
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device /dev/sdb4 /mnt
btrfs device: unknown token '/dev/sdb4'
usage: btrfs device <command> [<args>]

    btrfs device add [options] <device> [<device>...] <path>
        Add one or more devices to a mounted filesystem.
    btrfs device delete <device>|<devid> [<device>|<devid>...] <path>
    btrfs device remove <device>|<devid> [<device>|<devid>...] <path>
        Remove a device from a filesystem
    btrfs device scan [-d|--all-devices] <device> [<device>...]
    btrfs device scan -u|--forget [<device>...]
        Scan or forget (unregister) devices of btrfs filesystems
    btrfs device ready <device>
        Check and wait until a group of devices of a filesystem is ready for mount
    btrfs device stats [options] <path>|<device>
        Show device IO error statistics
    btrfs device usage [options] <path> [<path>..]
        Show detailed information about internal allocations in devices.

manage and query devices in the filesystem
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device delete /dev/sdb4 /mnt
ERROR: error removing device '/dev/sdb4': Invalid argument
[liveuser@eos-2020.07.15 ~]$ sudo btrfs device remove /dev/sdb4 /mnt
ERROR: error removing device '/dev/sdb4': Invalid argument

I just came back home.
It seems that now you have the both drive recognize.

Let me read again.

EDIT : in the guide this is what they have as result :

btrfs filesystem show /mnt
# Label: none  uuid: c277ed84-e32f-4204-a211-1d80596e6e15
# 	Total devices 2 FS bytes used 5.08GiB
# 	devid    1 size 55.49GiB used 8.02GiB path /dev/mapper/data_vda-root
# 	devid    2 size 55.49GiB used 0.00B path /dev/mapper/data_vdb-root

Could you show me this :

lsblk

[liveuser@eos-2020.07.15 ~]$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0   1.7G  1 loop /run/archiso/sfs/airootfs
sda      8:0    0 119.2G  0 disk 
├─sda1   8:1    0   498M  0 part 
├─sda2   8:2    0     4G  0 part 
├─sda3   8:3    0     4G  0 part 
└─sda4   8:4    0 110.8G  0 part /mnt
sdb      8:16   0 119.2G  0 disk 
├─sdb1   8:17   0   498M  0 part 
├─sdb2   8:18   0     4G  0 part 
├─sdb3   8:19   0     4G  0 part 
└─sdb4   8:20   0 110.8G  0 part 
sdc      8:32   0 931.5G  0 disk 
└─sdc1   8:33   0 815.2G  0 part 
sdd      8:48   1  14.6G  0 disk 
├─sdd1   8:49   1   1.8G  0 part /run/archiso/bootmnt
└─sdd2   8:50   1    64M  0 part 

did you try to mount sdb4 with GParted ?
If I understood your device is sda and you would use sdb as RAID1 managed by btrfs !

Coiuld you try this :

btrfs device ready /dev/sda4

Almost but not quite. I want to use it as RAID 0. And the option to mount sdb4 is greyed out in gparted and I definitely mount it through that anyway.

I ran it and there wasn’t any output, so it probably did something.

It supposes to check and wait until a group of devices of a filesystem is ready for mount

When you try to install which is the error message now ?

Then retry the mnt I don’t see why it doesn’t want to mount :

btrfs device add /dev/sdb4 /mnt

Sorry for my slow responses. I’ve been doing other things because I’m just so discouraged by this falling apart at the last possible moment. Anyway, regardless of if I try to reformat it back to btrfs with gparted, or run that command, I get the same error:

ERROR: unable to open /dev/sdb4: Device or resource busy

EDIT: Fixed it! I had to restart and boot back into the live iso. I’ve successfully ran the following:

[liveuser@eos-2020.07.15 ~]$ sudo btrfs balance start -dconvert=raid0 -mconvert=raid0 /mnt
Done, had to relocate 12 out of 12 chunks
[liveuser@eos-2020.07.15 ~]$ sudo btrfs filesystem usage /mnt
Overall:
    Device size:		 221.51GiB
    Device allocated:		  20.06GiB
    Device unallocated:		 201.45GiB
    Device missing:		     0.00B
    Used:			   7.50GiB
    Free (estimated):		 212.17GiB	(min: 212.17GiB)
    Data ratio:			      1.00
    Metadata ratio:		      1.00
    Global reserve:		  21.56MiB	(used: 0.00B)
    Multiple profiles:		        no

Data,RAID0: Size:18.00GiB, Used:7.27GiB (40.39%)
   /dev/sda4	   9.00GiB
   /dev/sdb4	   9.00GiB

Metadata,RAID0: Size:2.00GiB, Used:233.73MiB (11.41%)
   /dev/sda4	   1.00GiB
   /dev/sdb4	   1.00GiB

System,RAID0: Size:64.00MiB, Used:16.00KiB (0.02%)
   /dev/sda4	  32.00MiB
   /dev/sdb4	  32.00MiB

Unallocated:
   /dev/sda4	 100.72GiB
   /dev/sdb4	 100.72GiB
2 Likes

So you will run this now in following the guide and get sdb work ?
(passes all data in the filesystem through the allocator again)

btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

Then to see the both :

sudo btrfs filesystem usage /mnt

image
We did it! I’ve successfully restarted into then new environment. We’re all done, for the most part. All that’s left to do now(maybe) is to clean things up a bit. Everything works, RAID 0 works perfectly, but you can also see the drives individually as well as combined.
image
If that’s not something that can be fixed, I really don’t care. I am so happy! I never thought I’d actually be able to pull this off. Thank you guys so much!

3 Likes

Great, you did it !
Just to know, you got it in redoing the latest raid1 mnt below or was not necessary ?
Could be usefull for others…

btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

Enjoy your EndeavourOS :rocket:

1 Like

I ran that command but replacing raid1 with raid0. Worked perfectly!

EDIT: It’s not letting me edit the original post or change the title, so if a mod sees this, can you mark it as solved?

2 Likes

Happy for you, you were patient and you deserve it.

2 Likes

You were very patient as well! :smiley:

1 Like

Okay so now you have to explain exactly how to do it. :stuck_out_tongue_closed_eyes: I have 2 500 GB nvme drives on my system i could try it. Not sure i want to go through all of it though. :laughing:

1 Like

Would be great to have a wiki about it, lot of users asking for it.
Maybe @killbotvii you could show a screenshoot of your GParted from raid to see the final schema ?

I would try it maybe but i would be starting also from scratch. Since i already have EndeavourOS installed then i would be wiping it out and changing the partioning to btrfs and reinstalling and setting up raid 0 or 1?

Sorry i wasn’t around to help but you probably know more about it than me now! :rofl:

Thanks @ricklinux you are part of the success. :+1:

1 Like

I have never actually installed it myself. I just read stuff about mdadm. I’m not sure how he installed it as i wasn’t following. I know it’s raid 1 but is he using encryption? (luks) or not? and also lvm? or just btrfs with raid 1 and does that give it the ability to do snapshots? Or is it just btrfs and raid 1 without any fancy stuff.

nope I don’t think it’s with Luks.

With the https://mutschler.eu/linux/install-guides/pop-os-btrfs-raid1/#step-4-post-installation-steps
and btrfs command it helped a lot + this Thread now

usage: btrfs device <command> [<args>]

    btrfs device add [options] <device> [<device>...] <path>
        Add one or more devices to a mounted filesystem.
    btrfs device delete <device>|<devid> [<device>|<devid>...] <path>
    btrfs device remove <device>|<devid> [<device>|<devid>...] <path>
        Remove a device from a filesystem
    btrfs device scan [-d|--all-devices] <device> [<device>...]
    btrfs device scan -u|--forget [<device>...]
        Scan or forget (unregister) devices of btrfs filesystems
    btrfs device ready <device>
        Check and wait until a group of devices of a filesystem is ready for mount
    btrfs device stats [options] <path>|<device>
        Show device IO error statistics
    btrfs device usage [options] <path> [<path>..]
        Show detailed information about internal allocations in devices.