Gut feeling something is wrong

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
OK I'm back...

I've migrated all the VMs away from the ZVol and deleted it. However i'm still left with the disk pool and that still says 46% fragmented.
It also says it has 7.67TiB used, despite me deleting the only ZVol on the pool.

How do I cleanse the disk pool to remove fragmentation? I'm not that worried about doing things to this box now it's not doing anything in my network (in fact the next thing i'm gonna do is install the pending update and then schedule some time to install that RAM).
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
Run the script and you should be ok regarding fragmentetion.
Thanks - can I have a quick tutorial on running scripts in TrueNAS? Is the only way to SSH in and create a text file with the commands and then execute it? or is there something I can type at the shell prompt to download the script and execute it from somewhere? (see, Windows guy here)
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Also, how does the script get rid of that 7.67TiB?
It doesn't. It removes fragmentation.
Check if you have any snapshot of the delete zvol, maybe it's them.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Thanks - can I have a quick tutorial on running scripts in TrueNAS? Is the only way to SSH in and create a text file with the commands and then execute it? or is there something I can type at the shell prompt to download the script and execute it from somewhere? (see, Windows guy here)
Activate the SSH service. Then you can either use the CMD, the powershell or something like putty to connect.
By terminal just run ssh user@webui_IP. You will be prompted with the user's password. I suggest to log in as root.

First thing to do once inside is to enter tmux: tmux new.

Then, follow this to download the file.

Then, follow the instructions in the script's page. Basically, you have to write ./zfs-inplace-rebalancing.sh /mnt/YOUR POOL NAME and you go.

You can then quit the window and let the program do its thing, don't reboot the nas, don't move files.
When you want to check how it's going log again and write tmux attach.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Is the only way to SSH in and create a text file with the commands and then execute it?
That's exactly what "script" means. A text file containing a series of commands. You can use copy & paste, right?
 

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
That's exactly what "script" means. A text file containing a series of commands. You can use copy & paste, right?
Yes, of course I can, I was just wondering whether there was a way, similar to an apt-get whereby you could download a whole stored script on a share somewhere and execute it with a single pasteable command.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
That's exactly what "script" means. A text file containing a series of commands. You can use copy & paste, right?
He can download the script without the need to learn how awful the copy paste process inside a terminal is :tongue:
 

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
It doesn't. It removes fragmentation.
Check if you have any snapshot of the delete zvol, maybe it's them.
Turns out I just don't have patience, and that it takes more than milliseconds to delete 9TiB of data. The used disk space count is dropping as we speak.
 

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
...as is the fragmentation. I might not actually need the script at this rate! :)
 

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
So I got down to a steady 774Gb in the pool so I started the script...except it doesn't seem to have done a thing:

Code:
root@truenas[~]# ./zfs-inplace-rebalancing.sh /mnt/"Colit Disk Pool"
Start rebalancing Mon Oct  9 22:43:13 BST 2023:
  Path: /mnt/Colit Disk Pool
  Rebalancing Passes: 1
  Use Checksum: true
  Skip Hardlinks: false
  File count:        0


Done!
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
Doesn't appear to be...

Code:
root@truenas[~]# cd /mnt
root@truenas[/mnt]# ls
Colit Disk Pool md_size
root@truenas[/mnt]# cd Colit\ Disk\ Pool
root@truenas[/mnt/Colit Disk Pool]# ls
root@truenas[/mnt/Colit Disk Pool]# ls -al
total 1
drwxr-xr-x  2 root  wheel    2 Aug 10  2022 .
drwxr-xr-x  3 root  wheel  128 Oct  9 21:57 ..
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
He can download the script without the need to learn how awful the copy paste process inside a terminal is :tongue:
The copy & paste process in my terminal sessions is perfectly fine, you are not talking about the web UI "shell", are you?

Please, people, anyone intending to use TrueNAS, OPNsense or any other Unix based open source appliance and refusing to just use SSH should probably look for a different product. You cannot meaningfully debug or troubleshoot TrueNAS without using the terminal of your desktop OS of choice and SSH.
 

Colit

Dabbler
Joined
Oct 2, 2023
Messages
37
The copy & paste process in my terminal sessions is perfectly fine, you are not talking about the web UI "shell", are you?

Please, people, anyone intending to use TrueNAS, OPNsense or any other Unix based open source appliance and refusing to just use SSH should probably look for a different product. You cannot meaningfully debug or troubleshoot TrueNAS without using the terminal of your desktop OS of choice and SSH.
Can I point that all the above came from putty which was already on my system. I'm not a total noob, but just like to ask questions that have been bugging me for a while.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
In theory no. However I don't know what the 7.72Gb "allocated" is.
Then you don't need to use the script!
Did you delete the snapshots?

As a side note, we could make that SSH connenction a bit safer using keys instead of passwords. Interested?
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
The copy & paste process in my terminal sessions is perfectly fine, you are not talking about the web UI "shell", are you?
I had misread your post and was indeed talking about the WebUI monstrosity.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
Silly question - why not just delete the pool and resetup the whole thing. Its got no data on it that you are interested in does it?
1. You may have to move the system dataset to the boot-pool (on a temp basis)
2. You may have to turn off iscsi - as that MIGHT lock the pool

This way - zero fragmentation, no smapshots, no data - and you were going to have to re-create the zvol anyway

the zfs-rebalance script will not help - as it doesn't touch zvols
 
Top