Help with FreeNAS and BSD in general - Page 1
Forum section: electronics / general

author: Halcyon
author_rank: Unknown
timestamp: February 26, 2018, 10:03:25 am
content: Firstly, I have tried the FreeNAS forums but they haven't been of any help. I've Googled and tried a number of different things, hopefully someone can help me who knows more about FreeNAS and BSD than I do.The story goes like this:I have/had FreeNAS installed on two hard disks in a mirror. Both disks are quite old (160 GB drives) so it's safe to say they weren't in the best condition when they went in (this is a development server so there is nothing critical on it, but I would like to iron out any issues before I build a production FreeNAS box). Both drives have started reporting SMART errors (sector reallocation count) so they are on their way out.I've physically removed and replaced one of the boot drives with an identical spare (same size, firmware, model etc...) but it probably has pre-existing data and partitions on it. However when I attempt to "attach" it to the mirror, I get the following error:Code:[MiddlewareError:  'gpart create -s gpt -f active /dev/ada1' failed:gpart: geom 'ada1': Operation not permitted]It seems no matter what I try and do with ada1, it doesn't let me (despite being logged in as root).I also tried to wipe it both in the GUI and using the shell but all I get is this:Code:Sorry, user root is not allowed to execute '/bin/dd if=zero of=ada1 bs=1G' as root on .I have managed to detach the removed drive, so the boot just shows up at a single disk in a "stripe", however I can't seem to re-add the new disk into a mirror.

author: BradC
author_rank: Super Contributor
timestamp: February 26, 2018, 11:27:33 am
content: I could probably help you with the Linux part, but FreeNAS is *bsd based and I have _zero_ experience there.

author: Halcyon
author_rank: Unknown
timestamp: February 26, 2018, 11:35:06 am
content: Quote from: BradC on February 26, 2018, 11:27:33 amGood point, OP amended

author: Ampera
author_rank: Super Contributor
timestamp: February 26, 2018, 11:43:35 am
content: If it's a question of getting data off, I would rush it to the nearest IBM compatible desktop Linux installation and grab it all off.I tried to use Unix as an SSH server so I could do programming. System V distros were unendingly confusing, and FreeBSD was just broken across the board for me, but that could just be me.I'm a personal fan of Arch Linux, and while I know it's a stupid suggestion to tell you to use something else, that's my personal suggestion, as Unix is Linux, but for people who are masochists.

author: grumpydoc
author_rank: Super Contributor
timestamp: February 26, 2018, 11:53:54 am
content: Hmmm....I last noodled with BSD systems when SunOS was BSD based, so like others I'm guessing a bitAssuming you aren't running into a security issue (does BSD have the equivalent of selinux?, I can't check at the moment). it could be that the kernel thinks the device is in use which is why it isn't letting you play ball, check the kernel messages to see if that throws any light on the situation.Have you another disk to try?Also that 1G blocksize in dd looks a bit ambitious - you don't need it that big, DD will keep going until the drive is full unless you restrict the amount of data written with a count= argument. Drop the blocksize to 4k and see if that helps.

author: grumpydoc
author_rank: Super Contributor
timestamp: February 26, 2018, 08:42:00 pm
content: Quote from: grumpydoc on February 26, 2018, 11:53:54 amOK, yes *BSD does have securelevel which can restrict even the root account.run "sysctl -n kern.securelevel" - if the value is >0 thatcouldbe why the gpart command failed.Seehttps://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/security.html#idp64321744for more info and how to reset it (basically edit /etc/rc.conf and reboot)

author: Halcyon
author_rank: Unknown
timestamp: February 26, 2018, 09:28:18 pm
content: Quote from: TwoOfFive on February 26, 2018, 11:43:35 amNah not the case as all. As I mentioned, this is just a development server. It has nothing on it. I've run it up as a test to make sure everything works correctly (including the boot mirror) so if something happens on the production, I know how to handle it. The intention is to replace my old Windows 2003 NAS with FreeNAS and a ZFS file system.Quote from: grumpydoc on February 26, 2018, 08:42:00 pmI get -1 returned with that command.Just reading into a bit more, it looks like there is a known issue in the build I'm running (it has only recently been updated in the last week or so).https://redmine.ixsystems.com/issues/27834I might try back up the config, blow away the whole install then import the config back again in the new version.

author: Ampera
author_rank: Super Contributor
timestamp: February 26, 2018, 09:52:44 pm
content: The problem is you're not running a PDP-11, try to upgrade your hardware for better compatibility.