Removing disk from pool

Status
Not open for further replies.

mvcorrea

Cadet
Joined
Jan 30, 2014
Messages
4
Hi there,
1st post, already searched without an exact match.
System: FreeNAS-9.2.0-RELEASE-x64/

Situation. a 3 disks zpool with a problem in a single disk
I did "zfs set readonly=on Local1" and I think, stabilized the problem
I managed to copy most of the files to an external disk, now I want to remove the defected disk
Now the poll is about 25% used (enough to fit the remaining data in 2 disks).
Any way to put all the data (readable data) in the disks working ok? And remove the defected one?

[root@freenas] /mnt/Local1# zpool status -v Local1
pool: Local1
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 0 in 11h56m with 1 errors on Sun Sep 28 11:56:03 2014
config:

NAME STATE READ WRITE CKSUM
Local1 ONLINE 2 0 0
ada1p2 ONLINE 0 0 0
ada2p2 ONLINE 0 0 0
ada3p2 ONLINE 2 0 0

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

/mnt/Local1/movies/XXX.Bluray.x264.CBGB.mkv
[root@freenas]

Without having Perl support in free nas(I do perl a lot). I manage to copy most of my files with a Python script ( I've never had programmed in python before), but could help someone in the same situation(suggestions?).
Code:
#!/usr/local/bin/python import os, re import datetime import shutil #src_dir = "/mnt/Local0/_pictures/" src_dir = "/mnt/Local0/pict_repetidas/" dst_dir = "/mnt/DSK/pictures_2014-09/" logArr = [] errArr = [] def modification_date(filename,count): basename = os.path.basename(filename) head, tail = os.path.splitext(basename) t = os.path.getmtime(filename) out = datetime.datetime.fromtimestamp(t) #out =head+'{:_%Y%m%d_%H%M%S.%f}'.format(out)+tail if(count > 0): out =head+'{:_%Y%m%d_%H%M%S}'.format(out)+"-"+str(count)+tail else: out =head+'{:_%Y%m%d_%H%M%S}'.format(out)+tail return out.upper().replace(" ", "_") def copy_files(src,dst): try: fileNum = 0 for root, dirs, files in os.walk(src_dir): cnt = 0 for file_ in files: src_ = os.path.join(root, file_) fname_ = modification_date(src_, cnt) dst_ = dst+fname_ while(os.path.exists(dst_)): #rename if already there cnt += 1 fname_ = modification_date(src_, cnt) dst_ = dst+fname_ errArr.append(src_+ " >>> " + dst_) cnt = 0 shutil.copy(src_, dst_) logArr.append(src_ +" >> "+ dst_) fileNum += 1 print "ficheiros processados: "+str(fileNum) except (IOError, os.error) as why: errArr.append((src_, str(why))) copy_files(src_dir, dst_dir) errFile = open("errlog.txt", "w") for item in errArr: errFile.write("%s\n" % item) errFile.close() logFile = open("pictlog.txt", "w") for item in logArr: logFile.write("%s\n" % item) logFile.close() # vim: ai ts=4 sts=4 et sw=4 ft=python​



best regards,
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You have no redundancy. Your only good option is to destroy the pool and restore from backup.
 
Status
Not open for further replies.
Top