btrfs partition recognized as swap

SK4nda1@lemmy.ml to Sysadmin@lemmy.ml – 11 points –

Hey all,

Edit: changed confusing wording based on dack's comment.

I have a problem. I'm building a SAN and I'm playing around with btrfs to learn more about how to use it.

I run into the problem where my sdd1 partition is recognized as swap filesystem. I don't understand whats going on here. I formatted all these drives through my usb-dock via my desktop. All the others are fine, so why is this one giving me problems? I tried removing it with parted amd recreating it as btrfs or ext4 doesnt seem to help.

Does anyone have any insight of why this is happening?

root@server :~# lsblk --fs
....
sdc                                                                                                           
└─sdc1                       ext4        1.0            e3e8849d-a25e-4235-8ebf-ca84a7637f64                  
sdd                                                                                                           
└─sdd1                       swap        1              445ae89e-05ef-4fd0-98e3-b592fb2a8a9c                  
sde                                                                                                           
└─sde1                       btrfs                      bc864736-2bf6-4379-aa57-46f1c0f3a95d 
4

There is a filesystem type field in the partition table. Formatting the partition won't change it. Delete the partition and recreate it with the correct filesystem type. In parted you can do that with "mkpartfs".

Ah my apologies, I used the word formatted incorrectly. I use parted to do: ''' Rm 1 Mkpart primary btrfs 1 3,6T '''

Parted then shows the btrfs filesystem. If I then quit and look at 'lsblk -fs' it shows me the table in my post. I think I do this right. Im going to remove the disk and see how it behaves on another pc.

After creating it with mkpart, are you formatting it with mkfs.btrfs? You need to both steps (create partition and format it). Also, try running partprobe or rebooting after making changes so that the kernel re-detects it.

Hey thanks! Thats it. mkfs.btrfs fixed it. Its weitd though that the other disks were recognized correctly.

Now I can go and experiment with raid setups