Importing ext4 disk?

Vectorspace

Dabbler
Joined
Oct 18, 2019
Messages
13
From what I gather from the user guide and searching this forum, this is only possible sometimes. I have tried and failed, but I am new at this so I don't know if I've done something wrong, so I would like to double-check that there's nothing I can do.

My newly built FreeNAS box has a pair of new disks formatted as ZFS, and a pair of disks of older disks from my previous home-made NAS (Ubuntu + Samba) that were ext4 formatted and mounted together as raid10 (yes, 10. Should have been 1).
FreeNAS detects both disks, as /dev/ada3 and /dev/ada4

When I go to Storage -> Import Disk, it gives me the option of importing from \dev\ada3s1 or \dev\ada4s1. I have tried both. I pick the ext2fs option for filesystem type as that's the closest.

It then fails with this error:
Code:
Mount failed (exit code 1): mount: /dev/ada4s1: Invalid argument

Error: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 333, in run
    await self.future
  File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 364, in __run_body
    rv = await self.method(*([self] + args))
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 664, in nf
    return await f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/pool.py", line 448, in import_disk
    async with MountFsContextManager(self.middleware, volume, src, fs_type, fs_options, ["ro"]):
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/pool.py", line 192, in __aenter__
    await mount(self.device, self.path, *self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/pool.py", line 83, in mount
    output[1].decode("utf-8"),
ValueError: Mount failed (exit code 1):
mount: /dev/ada4s1: Invalid argument


Is there anything else that I can try? Something less complicated than my last ditch plan of:
  • Install a Linux distro on a USB and boot from it
  • In Linux, mount one of the ext4 drives (I assume I can do that?), and format the other as FAT32
  • Copy the relevant data from the ext4 drive to the FAT32 drive
  • In FreeNAS, import the FAT32 drive to the existing ZFS pool
 
D

dlavigne

Guest
You shouldn't be getting a traceback. Please create a report at bugs.ixsystems.com and post the issue number here.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You could also use ZFS on Linux to just copy the data directly to a pool you already created on the same box in FreeNAS.

If you have the option of a small Linux box (like a Pi or an old laptop), you could attach the disk(s) containing relevant data via USB (with a cradle/dock) and rsync it across to FreeNAS.
 

Vectorspace

Dabbler
Joined
Oct 18, 2019
Messages
13
You could also use ZFS on Linux to just copy the data directly to a pool you already created on the same box in FreeNAS.
I thought about that, but I imagine that since the ZFS drives are mirrored I would need to mount them together in order to copy without making them out of sync? I don't know how to do that.

I have additional information. I have a monitor currently hooked up to the FreeNAS box. It was off, so I did not notice until now that it output additional error information when I attempted the import - information that the Web GUI did not show:
Code:
mount of ada3s1 denied due to bad gd=0 csum=0x29ee, expected=0xe4fd - run fsck

I did see fsck mentioned in the user guide around importing ext4. How in some cases ext4 drives would need an external fsck utility run on them before importing.
Should I try installing E2fsprogs utilities and running fsck on one of the drives? If so, how do I install it? And what does it actually do to the drive?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
fsck is the checkdisk(windows equivalent) or drive integrity check software that detects various types of filesystem errors and can also scan for physical errors on the disk.

Running one of the linux live distributions (from USB) should give you that utility.
 

Vectorspace

Dabbler
Joined
Oct 18, 2019
Messages
13
Forgot to mention - the ext4 disks were software raid, not hardware. Done in Ubuntu in 2013 (version 13.something I think)
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I think the ZFS on Linux option is the best bet to get data transferred to the ZFS disks, then put them on FreeNAS.

I'm not really clear on how your disks were configured (you can't do RAID 10 on only 2 disks... do you effectively mean RAID 0?)
 

Vectorspace

Dabbler
Joined
Oct 18, 2019
Messages
13
To be honest I cannot remember very well - it was 6 years ago. I know I meant to use RAID 10, it's in my notes from back then. I expect I read somewhere it was recommended, but missed the bit about it being for 4+ disks. So maybe it is actually RAID 0 or RAID 1 that I ended up with.
 
Top