safe way to replace corrupted file on boot device?

Status
Not open for further replies.

ikke

Contributor
Joined
Apr 22, 2012
Messages
124
Hi,

I started getting complaint from freenas about a corrupted file on boot device. The file is not critical, it's /usr/local/lib/libbiconv.a. I see it comes from iconv-2.0_4 package. But why doesn't the "pkg list" command show iconv being installed? Is it due it being installed withing "bootstrap", prior to using pkg?

Is it safe to do pkg install iconv, and let it overwrite the file, or should I download the iconv binary package and extract the file from there?

---------------------------
[root@freeknas] ~# zpool status -v freenas-boot
pool: freenas-boot
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://illumos.org/msg/ZFS-8000-8A
scan: scrub repaired 216K in 0h2m with 1 errors on Sun Feb 22 03:47:12 2015
config:

NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 1
mirror-0 ONLINE 0 0 2
gptid/1f08078c-9e3c-11e4-a2fb-c86000887167 ONLINE 0 0 13
gptid/1f98e245-9e3c-11e4-a2fb-c86000887167 ONLINE 0 0 2

errors: Permanent errors have been detected in the following files:

//usr/local/lib/libbiconv.a
[root@freeknas] ~# pkg which /usr/local/lib/libbiconv.a
/usr/local/lib/libbiconv.a was installed by package iconv-2.0_4
[root@freeknas] ~# pkg --list|grep iconv
[root@freeknas] ~#​

---------------------------

Thanks,
ikke
 

ikke

Contributor
Joined
Apr 22, 2012
Messages
124
Ah, that was dumb, not pkg --list, but info. Anyways, re-install fails:

-----------------------
[root@freeknas] ~# pkg remove iconv Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
iconv-2.0_4

The operation will free 254 kB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deleting iconv-2.0_4: 2%
pkg: cannot stat /usr/local/include/biconv.h: No such file or directory
[1/1] Deleting iconv-2.0_4: 4%
pkg: fread(): Input/output error
[1/1] Deleting iconv-2.0_4: 34%
pkg: cannot stat /usr/local/man/man1/biconv.1.gz: No such file or directory
[1/1] Deleting iconv-2.0_4: 36%
pkg: cannot stat /usr/local/man/man3/biconv.3.gz: No such file or directory
[1/1] Deleting iconv-2.0_4: 39%
pkg: cannot stat /usr/local/man/man3/biconv_close.3.gz: No such file or directory
[1/1] Deleting iconv-2.0_4: 41%
pkg: cannot stat /usr/local/man/man3/biconv_open.3.gz: No such file or directory
[1/1] Deleting iconv-2.0_4: 100%
[root@freeknas] ~# pkg install iconv
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local
All repositories are up-to-date.
The following 1 packages will be affected (of 0 checked):

New packages to be INSTALLED:
iconv: 2.0_4

The process will require 254 kB more space.
40 kB to be downloaded.

Proceed with this action? [y/N]: y
Checking integrity... done (0 conflicting)
pkg: archive_read_open_filename(/usr/ports/packages/All/iconv-2.0_4.txz): Failed to open '/usr/ports/pac
kages/All/iconv-2.0_4.txz'
-----------------------
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Neither. You should do a reinstall of FreeNAS.

Considering that both of your boot devices have non-zero checksum errors I'd say that you should also seek out reliable boot devices AND do a reinstall to that media followed by uploading your config file.
 

ikke

Contributor
Joined
Apr 22, 2012
Messages
124
I just bought the both usb sticks just month ago for this use. I didn't expect those kingstons to be crap. Damned.
 

ikke

Contributor
Joined
Apr 22, 2012
Messages
124
Before I do replace the sticks, could someone please point to location I could find that file? I suppose it needs to be from either another install, or from the build system that creates the installation build. It could perhaps be attached here, as it's only 63k.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You should be able to pull it from the upgrade file for the exact build you have. The upgrade files are in download.freenas.org.
 
S

sef

Guest
Do NOT try to use the pkg tools to install portions of FreeNAS.

I'm sorry your Kingstons were bad; I have used some myself. I'm getting a lower opinion of thumb drives here than I had in my previous job, and I hated them there as well. (Not your fault -- as I said, I've used them myself.) In general, it might be a good idea to use two different manufacturers, if at all possible. Or at least two different lots if you do end up using the same manufacturer.

If you've got a corrupt file, you have several options:

  1. Save your config database somewhere and re-install from scratch.
  2. As described above, try to get the file from an update file.
  3. If you have multiple boot environments, you could try reverting to one of those, and then doing an update.
  4. Alternately, if you have multiple boot environments, you could try grabbing the file from the most recent snapshot. This isn't really recommended, except as an emergency option, since you don't know that it's the same version as what you lost.
And for you, in particular, replace at least one of your thumb drives. Good luck.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Anything with Kingston's name is in question these day. That's just what I've seen around here.
 

ikke

Contributor
Joined
Apr 22, 2012
Messages
124
Got the file from the downloads cyberjock pointed to, thanks. Thanks also for the suggestions sef. I will replace a stick the next time I get to the box, atm it's a bit troublesome to get physically to the box.
 
Status
Not open for further replies.
Top