safely remove slog

Joined
Feb 13, 2017
Messages
12
Hi, I am a long time reader first time poster. I made a BIG mistake on a FreeNAS setup. I used a USB flash drive for the (zil/slog) and now I need to remove it.

I followed this post to set it up in the terminal instead of using the web gui
https://forums.freenas.org/index.php?threads/how-to-add-an-slog.16766/

this is the instruction form the post I used
"
Here we go:
  • I had this SSD set up as a whole-disk separate log because that's the way the FreeNAS interface does things and this is my second installation. I needed to delete the existing partition first.
  • First, I checked DMESG output to find the name of the SSD device: less /var/run/dmesg.boot. It turns out it was ada0
  • Next, I checked the partitions/slices on the drive to see what was up. gpart show ada0
  • The display was confusing - the name of the device, a free section, then the freebsd-zfs partition, then another free bit. That formatted one was actually partition one, so gpart delete -i1 ada0 removed it. What does i stand for? No idea.
  • <-- If you are installing a new, unformatted SSD, then everything above this line is stuff you didn't have to do. -->
  • Now I needed to create the partition. I guessed at a size of 2 gigs, so I used this command: gpart add -t freebsd-zfs -l slog -s 2G -b 1M ada0. "slog" there is the name of the partition I'm creating. The 1M is an offset, so now the first 1M of the drive is free, then there's a 2G freebsd-zfs partition, then the rest of the drive is free.
  • From there, I needed to add it to the pool. The name of my pool is nas1mirror, so the command was zpool add nas1mirror log /dev/gpt/slog. nas1mirror and slog will probably differ for everyone else, because those are names I chose. Maybe you'll use tank and ZIL or something.
After that, zpool status nas1mirror showed the SLOG was up and running as part of the Zpool.
"

I read in some thread if you do this type of stuff the web gui won't know what you did so I am assuming I will have to remove the USB using the terminal
Here is the status of the pool

Code:
/mnt/freenas1# zpool status freenas1
  pool: freenas1
state: ONLINE
  scan: scrub repaired 0 in 1h25m with 0 errors on Sun Feb 26 01:25:03 2017
config:

   NAME  STATE  READ WRITE CKSUM
   freenas1  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	gptid/ba631a65-f9ce-11e5-aae3-a0369f3e7304  ONLINE  0  0  0
	gptid/bb0eca1e-f9ce-11e5-aae3-a0369f3e7304  ONLINE  0  0  0
	mirror-1  ONLINE  0  0  0
	gptid/bbbc152e-f9ce-11e5-aae3-a0369f3e7304  ONLINE  0  0  0
	gptid/bc6a0ea4-f9ce-11e5-aae3-a0369f3e7304  ONLINE  0  0  0
   logs
	gpt/slog  ONLINE  0  0  0

errors: No known data errors


From what I understand but unsure of is using this command to fix it
zpool remove freenas1 slog

if I use that command will it break my FreeNAS setup or destroy my pool?
 
Last edited by a moderator:

m0nkey_

MVP
Joined
Oct 27, 2015
Messages
2,739
zpool remove <tank> <device>
In your case the command would be
zpool remove freenas1 gpt/slog
It is recommended to backup your data and config prior to removing the SLOG device.
 
Joined
Feb 13, 2017
Messages
12
I don't plan to replace the USB slog that is currently in the system so when I remove it where does it go? Will I have to run the zpool add <tank> log <device> where device would be one of my hard drives in the pool? or does it just fall back into some internal zil for the pool?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I also feel like I should ask why you thought you needed a SLOG and also why a slow USB device would work for that, because we need to make sure that isn't recommended anywhere.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
USB SLOG? More like slow-as-ASS-LOG.

Seriously, that's a very weird thing to do.
 
Joined
Feb 13, 2017
Messages
12
ok after reading though http://doc.freenas.org/9.10/zfsprimer.html, I think I understand what happens, it basically goes back to a normal setup without the slog attach. The reason I added the slog was because there is a database VM running on the NAS unit and after some bench-marking I saw great improvement. It has been running for about a year with out issues but after recently digging into forum threads I saw it was a bad idea and just wanted to fix it.
 
Joined
Feb 13, 2017
Messages
12
Just a follow up. I was able to remove the slog. after the command was issued it took 24 minutes to complete. It looks like all the data is still there and everything is running fine still.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
You can still add an SSD SLOG
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Does it have a PCIe SAS card installed?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

sunshine931

Explorer
Joined
Jan 23, 2018
Messages
54
Like chris said - old post.. but here's how to remove an slog mirror pair.

zpool status -v <pool name>

Find the "mirror-X" item that represents your log devices, where X is a number. I have 12 mirrored vdevs (0 - 11), and my mirrored slog devices were "mirror-12".

Note the device names for the two devices.

zpool remove <pool> <mirror-X> <device1> <device2>
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Like chris said - old post.. but here's how to remove an slog mirror pair.

zpool status -v <pool name>

Find the "mirror-X" item that represents your log devices, where X is a number. I have 12 mirrored vdevs (0 - 11), and my mirrored slog devices were "mirror-12".

Note the device names for the two devices.

zpool remove <pool> <mirror-X> <device1> <device2>
You can't add a mirrored SLOG from the GUI, but I think you can remove it from the GUI. I think I did that before.
 

sunshine931

Explorer
Joined
Jan 23, 2018
Messages
54
It's the opposite - I added via the GUI (and it doesn't tell you it's creating a mirror, it just does create a mirror when two devices are provided). I couldn't find any way to remove them via the GUI.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Click the disk and there should be a remove option. Pretty sure that's how it goes.
 

sunshine931

Explorer
Joined
Jan 23, 2018
Messages
54
In theory, sure. That's how I tried to do it, seeing as the GUI allowed me to add the mirrored pair for SLOG. Instead, you get an error telling you that you cannot remove the disk from your pool. I found no way to do it via the GUI from the disk, pool, or pool status screens.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
That might be a bug. Does the old GUI allow you to remove the SLOG? Removing SLOG is 100% supported by ZFS, but it's possible that the middleware people let that slip.
 
Top