How to make use of external drives with TrueNAS SCALE?

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I plugged my 5TB HDD into my new ubuntu computer. It detects it but cannot mount it. Disks says the HDD is zfs_member.

Based on what was said earlier, should I plug the HDD back into my treuNAS server, import the HDD, then create a new pool?

Wont that erase my data?
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
If you intend to keep the data on the 5TB HDD, you DON'T create a new pool. That would wipe existing data.

Simply import, either a ZFS pool or EXT4 which you implied earlier.

If you need to see if it really if a ZFS pool member, from the command line, use zpool import. That is a harmless command and simply scans all unused disks to see if they are in a ZFS pool. If so, it prints the pool name and configuration.

If it turns out not to be a ZFS pool, you can try mounting it from the command line as EXT4;
mkdir /mnt/5tb_hdd mount -t ext4 /dev/sdX9 /mnt/5tb_hdd
Replace X with the drive letter, and 9 with the data partition.


This is one reason I don't recommend ZFS or TrueNAS to everyone. ZFS is just not common among casual computer users, or MS-Windows users. Their is a steeper learning curve with ZFS & TrueNAS, than some other consumer NAS software or devices. That said, you don't have to learn it all at once.
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
"Replace X with the drive letter, and 9 with the data partition."

Its listing my HDD as DA0 but it does not show the HDD's serial number. There is only 1 partition on the HDD according to my computer. Does this sound right?

mount -t ext4 /dev/sd00 /mnt/5TB
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Sorry, I forgot that some devices show up with different naming conventions. Plus, partitions generally start at 1 / one.

What does fdisk -l /dev/da0 show?
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
Illegal option

Screenshot from 2023-08-01 07-00-30.png


da0 still does not show a serial number under disks.
Screenshot from 2023-08-01 07-02-14.png
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Don't know what version TrueNAS SCALE is using, but my Linux desktop has that as a valid option. Can't help further because I don't know the other tools that perform this task.
 

NugentS

MVP
Joined
Apr 16, 2020
Messages
2,947
fdisk -l /dev/sda works just fine on my Scale setup
Code:
root@NewNAS[/mnt/BigPool/SMB/NewNAS-Scripts]# fdisk -l /dev/sda
Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors
Disk model: SanDisk SD8SBAT1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 49315D82-700B-4BA5-BCE7-FD64BEC7A99B

Device        Start       End   Sectors   Size Type
/dev/sda1      4096      6143      2048     1M BIOS boot
/dev/sda2      6144   1054719   1048576   512M EFI System
/dev/sda3  34609152 250069646 215460495 102.7G Solaris /usr & Apple ZFS
/dev/sda4   1054720  34609151  33554432    16G Linux swap

Partition table entries are not in disk order.
root@NewNAS[/mnt/BigPool/SMB/NewNAS-Scripts]#
 

opensourceFTW

Explorer
Joined
May 27, 2022
Messages
86
I tried again. I am able to select da0 to import it but it cannot, it fails.

Code:
Mount failed (exit code 1): mount: /dev/da0p1: Invalid argument


Full information
Code:
Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 355, in run
    await self.future
  File "/usr/local/lib/python3.9/site-packages/middlewared/job.py", line 391, in __run_body
    rv = await self.method(*([self] + args))
  File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 981, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool_/import_disk.py", line 54, in import_disk
    async with await self.middleware.call('pool.import_disk_mount_fs_context_manager', device, src,
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool_/import_disk_freebsd.py", line 96, in __aenter__
    await mount(self.device, self.path, *self.args, **self.kwargs)
  File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool_/import_disk_freebsd.py", line 54, in mount
    raise ValueError("Mount failed (exit code {0}):\n{1}{2}" .format(
ValueError: Mount failed (exit code 1):
mount: /dev/da0p1: Invalid argument


I tried different options as to where to import it. No folder under /root worked.
zpool import does not list anything.
 

u-Hu

Cadet
Joined
Mar 20, 2021
Messages
1
Searching for a solution to this very issue, I found this thread. A few months have passed - was there a solution?

I'm brand new to TrueNasScale, but have been running a few Qn@p boxes over the last 15 years, and server parks before that. I've been searching, but not found an easy way to move big amounts of data in and out of a Scale nas without using the network. I normally don't have a need for high network speeds, so running 1 Gbps networks most places. Now, when starting a new Scale nas, I needed to move some TB of data from a ntfs disk onto the nas share.
I suppose it's Qn@p that have made me lazy, because there you can connect any usb stick, or hdd on either usb or eSata, and copy data with the nas's built in file manager or by using the backup software. This is a very easy and super fast method when you need to move chunks of data around. I've been using it a lot.

Is this a missing feature in TrueNas, or is it only the Scale version which is not fully developed yet? Should this be a feature request?
I've been looking for replacements for the Qn@p boxes, but I'm not sure I have the right solution yet.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
@u-Hu - Local data import to TrueNAs SCALE is problematic from a production view. Meaning that moving data from an NTFS disk to SCALE's ZFS datasets won't cover all of these correctly;
  • Owner
  • Group
  • Permissions
  • Access Control Lists
  • Any other attributes
The best way iX has found to maintain those is to perform the task on a MS-Windows client, copying to a SMB share on the TrueNAS SCALE server.

Yes, moving Terror Bytes, (miss-spelling on purpose :smile:, can take a long time via the network. And local access would seem to be the solution. Up until something breaks, (not the file, the above listed metadata). Imagine spending days locally copying the data, just to find out you need to manually update Owner, Group, etc...

Here is what iX has to say on the subject;

While I wish this were different, it is what it is.


All that said, it may be possible to manually perform the copy. With the understanding that the file metadata is not going to be copied correctly, and will have to be manually fixed.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If you're desperate to avoid network copying, boot to a live CD/USB of Ubuntu and import the pool and do the copies.

There is no GUI or standard instruction for that, so you'll have to figure it out and be careful about not upgrading the pool with a different version of ZFS.
 
Top