SOLVED Broke my Server (Scale)

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
OK - so this afternoon I broke my server by poking around in a "Here be Dragons" area and got bit.
I have rebuilt the server, recovered three small pools, but that main pool was toast - doesn't matter - its all backed up and apart from a 3 day restore (ish) which is a nusiance - there is no issue - I did a full backup just before kicking the dragon in the unmentionables anyway.

However I have run into an issue (back to the "Here Be Dragons" area)

In FreeBSD I ran the following commands to create 3 SLOG partitions on a pair of Optanes which I then added as mirrored SLOG's to three different pools.
gpart create -s GPT nvd4 gpart create -s GPT nvd5 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd4 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd4 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd4 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd5 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd5 gpart add -t freebsd-zfs -a 1m -l slog -s 20G nvd5

Once I have the partitions I can find the ID and add them to the relevent pools. However this is Debian and so far my google-fu has failed to find a way of doing the equivalent.
I suppose I could Install & boot TN Core and use that to build the partitions - but that seems a very long way around the problem.

I can use parted to create a GPT label - but thats as far as it seems to take me

Anyone care to point in the right direction please?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
fdisk ?
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Assuming anyone is interested this is how I did it (after more hours bashing my head against a wall then I care to think about)
2 problems:
  1. Create partitions
  2. Assign partitions to log vdev
Create partitions:
After a lot of flailing around - I was pointed at an OpenZFS on Ubuntu document which pointed me at cgdisk an interactive (text based) program to partition disks - so I was finally able to create the 3 partitions on each disk. (type a504 if it makes a difference)
[I really hope there is an easier way]
I also used cgdisk to make a note of the unique part-uuid for all 6 partitions - unfortunately it displays in uppercase and the UUID is actually lowercase and case sensitive!

Assign Partitions to log vdev
ls /dev/disk/by-partuuid displayed a big block of part-uuid's on the system which I then compared visually to the list made from cgdisk
then it was a simple matter of
zpool add NVMePool log mirror /dev/disk/by-partuuid/"insert partuuid here" /dev/disk/by-partuuid/"insert partuuid here"

And I now have my SLOG's back, with no degraded pools and zpool iostat -v 1 shows data being written to the SLOG's at appropriate times.

cgdisk is part of a set of apps - so I suspect that a bit more research would find a way to do the equivalent of the FreeBSD gpart add rather than going through an interactive program, maybe

Now I just have to wait for the restores to complete

I did seriously think about installing TN Core 13 on a USB, booting that and partitioning that way
I don't know. This is where my lack of knowledge hits me.
In FreeBSD I told the partition it was a FreeBSD-ZFS. I didn't seem to be able to do that in fdisk - or maybe I missed it - or maybe it doesn't actually matter - I don't know enough to know

I suspect I am in the area of "know enough to be dangerous"

:cool:
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
under that disk with fdisk, you can change the partition type with t ... from what I can see, swap is type 19 Linux Swap (0657FD6D-A4AB-43C4-84E5-0933C84B4F4F) and it seems that SCALE chooses 67 Solaris /usr & Apple ZFS (6A898CC3-1DD2-11B2-99A6-080020736631) for pool data patritions.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
When I have finished restoring I shall put another disk in and experiment with fdisk. What you are saying there makes it look as though the type possibly doesn't actually matter - its just a convenience thing - so I could have done it with fdisk.

Still I learnt something, even if I did finish at 4:00 AM or so
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I second fdisk. It works just great for interactive command line use, with built in help. And yes, you can create GPT partitions as well as change the partition type.

While I like the concept of parted, it generally ends up being something I have either look up the syntax. Or use a GUI front end. Neither of which are as fast as fdisk.
 
Top