Can mount ext2 but can't see or read files...

Hi!

I'm trying to migrate my current home DIY Nas from Ubuntu Server to FreeBSD, and I'm "stumbling on small stones" as we used to say in my native idiom.

In order to backup and restore my data, I formatted some external HDDs in ext2 filesystem. They are perfectly readble/writable in Linux (both bare metal and in virtual machines), but in the FreeBSD system, I can mount them, but can only see the files and the folders in the "root" of the mount point. Beyond that, I enter in the folders but the appear empty (although they have data), and I can't extract a tar file (I can't get the error exactly right now).

I tried to use my google-fu to search ("freebsd mount ext2 but can't read files"), but found nothing.

Anybody knows what could be happening?

That's the sfdisk output of the external HDD:

Screenshot 2018-07-02 20.32.37.png
 
Since you say you can see the files in the root folder it is mounted properly.
The output from mount | grep ext2 should return something like
Code:
/dev/da8p1 on /mnt/red (ext2fs, local)

My guess is you are on the old syscons console in FreeBSD and there are files on your ext2 disk that have unicode characters in them.
In that case, the content of folders that contain at least one unicode character will make the whole content hide (it's there though).

FreeBSD has two console types:
sc (the old one, does not support UTF-8; not sure now, but it used to be default when booting in legacy mode)
vt (the new one; supports UTF-8; the default when you boot FreeBSD in UEFI mode)

What does the output of sysctl kern.vty show?
sc or vt
 
I remember that the in-kernel ext2 needs inodes of 128 bytes, so you may need to format that drive in FreeBSD with that setting. This usually works for me.

For one-shot data transfers I recommend tar, directly on the device without a file system. So the usb stick or disc is used as a tape.

Edit: example:
tar zcvf /dev/sdb /storage for Linux and
cd /storage; tar zxvf /dev/da0 on FreeBSD for extraction.
 
Since you say you can see the files in the root folder it is mounted properly.
The output from mount | grep ext2 should return something like
Code:
/dev/da8p1 on /mnt/red (ext2fs, local)

My guess is you are on the old syscons console in FreeBSD and there are files on your ext2 disk that have unicode characters in them.
In that case, the content of folders that contain at least one unicode character will make the whole content hide (it's there though).

FreeBSD has two console types:
sc (the old one, does not support UTF-8; not sure now, but it used to be default when booting in legacy mode)
vt (the new one; supports UTF-8; the default when you boot FreeBSD in UEFI mode)

What does the output of sysctl kern.vty show?
sc or vt

Hi!

Yes. Probably there are non-ASCII characters in some files/folders in this filesystem.

I don't have access to the physical console right now, but in an SSH session the output of the command returns "vt". On an IPMI session (through ikvm_html5 web console) is "vt" also.
 
I remember that the in-kernel ext2 needs inodes of 128 bytes, so you may need to format that drive in FreeBSD with that setting. This usually works for me.

For one-shot data transfers I recommend tar, directly on the device without a file system. So the usb stick or disc is used as a tape.

Edit: example:
tar zcvf /dev/sdb /storage for Linux and
cd /storage; tar zxvf /dev/da0 on FreeBSD for extraction.

Very interesting. I didn't know that was possible to use a disk like a tape. Good to know.

Unfortunately I'm afraid that I can't do this anymore, because I need the data that are in the disks. They are the backup.

I still can mount them on a Linux machine (vm or physical) and transfer the data through the network, but this would be the last resource. Anyway I would like to know why and how this happens.

Just out of curiosity: would exFAT be a better filesystem than ext2/3/4 for use between Linux and FreeBSD?

Thanks.
 
I don't have access to the physical console right now, but in an SSH session the output of the command returns "vt". On an IPMI session (through ikvm_html5 web console) is "vt" also.
Only on a local sc console (including IPMI) you'd run into this problem.
Your problem must be something else... but I don't know, sorry

Problem with exFAT (as with FAT16/32) vs ext2/3/4 is that they can't preserve the file permissions.
That's why tar is your best friend on those filesystem.

I have on rare occasions moved small amounts of data moved from Windows to FreeBSD and used FAT32 with tar, that works very well.
For tar archives greater 2GB I'd try what Crivens suggested.
 
I guess that the problem maybe related to the size of the disk...

I have this "red" and another that I call "blue", both is 4TB and both has this issue.

I have another two, one called "grey" and another called "black", both is 2TB, partioned and formatted same way as blue and red, and I can mount and see and access all files/folders in them with no issues at all.

It could be a limitation of the ext2?
 
A very remedial suggestion, but since I believe you said it is a removable disk, have your fsck(ed) the disk in question?
 
Back
Top