Total Pageviews

Sunday, January 20, 2013

Reattaching ZFS filesystem

I had let my external storage sit unattached for quite a while. I had blown away the system that had ZFS support on it, so had to start over. The filesystem was still there, I just didn't have anything to mount it. I had to build a Rocks cluster:

http://www.rocksclusters.org/wordpress/

 for another project. Luckily Rocks is based on Centos 6.3. After getting the frontend of the cluster up, I installed the ZFS software. After that, these are the steps I took to get the filesystem back:

 [root@cluster ~]# zpool  import
  pool: NAS
    id: 8081959002011209582
 state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and
    the '-f' flag.
   see: http://www.sun.com/msg/ZFS-8000-EY
config:

    NAS         ONLINE
      raidz2-0  ONLINE
        sdb     ONLINE
        sdc     ONLINE
        sdd     ONLINE
        sde     ONLINE


[root@cluster ~]#[root@cluster ~]# zpool  import NAS
cannot import 'NAS': pool may be in use from other system, it was last accessed by localhost.localdomain (hostid: 0x7f0100) on Sun Jan  1 18:50:23

use '-f' to import anyway

[root@cluster ~]# zpool import -f  NAS

[root@cluster ~]# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
NAS   77.8G  2.60T  77.8G  /NAS
[root@cluster ~]# ls -larth /NAS
total 13K
-rw-r--r--  1 root root     0 Nov 16  2011 junk
drwxr-xr-x  7 root root     9 Nov 16  2011 home
drwxr-xr-x 13  501 jboss   13 Nov 19  2011 tools
drwxr-xr-x  5 root root     6 Dec  1  2011 .
drwxr-xr-x  3 root root     3 Dec  1  2011 old-pc
drwxr-xr-x 29 root root  4.0K Jan 20 17:07 ..
[root@cluster ~]#

Built Frontend for Cluster

I have a 6 terabyte enclosure. Four 1.5 TB drives. I'm running raidz, so the final amount of storage is less than three TB. But I am more concerned about the data, than the space. I had let the RAID sit for a long time, but having started back up on my Linux From Scratch project again, I thought I needed to back it up. I bought an additional 1.5 exteranl drive and backed my work up, but disks are disks. I had been backing up to 64 GB flash drive and it died, so time to break out the real disks. In the mean time I had a need to bring up a Rocks cluster and start experimenting again. So after a couple of false starts I was able to build the frontend for a cluster and reattach my 'RAID'.



login as: gramos
Using keyboard-interactive authentication.
Password:
Rocks 6.1 (Emerald Boa)
Profile built 20:08 20-Jan-2013

Kickstarted 15:38 20-Jan-2013
[gramos@cluster ~]$
[gramos@cluster ~]$
[gramos@cluster ~]$ df -h /NAS
Filesystem            Size  Used Avail Use% Mounted on
NAS                   2.7T   78G  2.6T   3% /NAS
[gramos@cluster ~]$