SOLVED Exporting/Disconnecting drive failed!

Meya

Dabbler
Joined
Dec 5, 2018
Messages
39
Hello,

I recently upgraded to TrueNAS 12.2 and it went fine. Today, I backed up some files as I usually do: import an external drive, copy the files over, and then disconnect the drive. But today, I got this error:
1639346145213.png


What could this be? The complete traceback is this:
Code:
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 367, in run
    await self.future
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 403, in __run_body
    rv = await self.method(*([self] + args))
  File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 975, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool.py", line 1572, in export
    await self.middleware.call('disk.swaps_remove_disks', disks, {'configure_swap': False})
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1256, in call
    return await self._call(
  File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1213, in _call
    return await methodobj(*prepared_call.args)
  File "/usr/local/lib/python3.9/site-packages/middlewared/service.py", line 42, in l_fn
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 975, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/disk_/swap_remove.py", line 27, in swaps_remove_disks
    return await self.swaps_remove_disks_unlocked(disks, options)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/disk_/swap_remove.py", line 54, in swaps_remove_disks_unlocked
    await run('swapoff', devname)
  File "/usr/local/lib/python3.9/site-packages/middlewared/utils/__init__.py", line 62, in run
    cp.check_returncode()
  File "/usr/local/lib/python3.9/subprocess.py", line 460, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '('swapoff', '/dev/mirror/swap0.eli')' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 371, in run
    raise handled
middlewared.service_exception.CallError: [EFAULT] Command swapoff /dev/mirror/swap0.eli failed (code 1):
swapoff: /dev/mirror/swap0.eli: Cannot allocate memory


The back up completed just fine but I don't want to simply unplug the drive since I'm afraid it can become corrupted. Some advice please?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Looks like the swap partition on the external drive got included in the swap0.eli mirror. You'll have to:
  1. Manually export the pool from the Shell via zpool export -f <name of your external pool>
  2. Shutdown
  3. Disconnect the external drive
  4. Power back up.
Then take your external drive to another system with GPartd, and delete the swap partition, so this won't happen again in the future.
 

Meya

Dabbler
Joined
Dec 5, 2018
Messages
39
Thank you, I was able to disconnect the drive. Regarding the deletion of the swap partition, can I connect the external drive to my PC and delete it?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, you can use the Windows diskpart CLI tool to delete the partition.
 
Top