Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had a zpool we'll call 'testpool'.

testpool had 3 devices included in it, and a single zfs called 'test'.

I needed to move 'test' to a new, smaller pool. I wanted to name the new pool the same name 'testpool'.

Basically did the following.

zfs send testpool@backup > /tmp/test-dump
zpool export -f testpool
zpool create -f testpool newdevice
zfs receive -F testpool < /tmp/test-dump

Unfortunately I found out that the testpool@backup snapshot was the wrong snapshot. Too old. I have yet to reallocate the three devices that were in the OLD testpool. (None of these 3 devices are 'newdevice', they are a separate 3.)

Is there any way I can recover data in those devices? I'm thinking since I named the new, smaller pool the same as the old zpool, I'm pretty much SOL. But if not, that would be nice to know.

Edit: More info

I did a 'zpool import' and got this.

bash-3.00# zpool import
  pool: testpool
    id: 14781458723915654709
 state: ONLINE 
action: The pool can be imported using its name or numeric identifier.
config:

    testpool    ONLINE
      c5t8d0    ONLINE
      c5t9d0    ONLINE
      c5t10d0   ONLINE

So I'm guessing I just need the syntax to import this zpool using its numeric identifier, while giving it a new name.

S.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Yes. You can run zpool import with no arguments, and it will identify the available pools for you.

Asssuming the devices from the old testpool are still there, you will see the "old" testpool, and alongside it a GUID for the pool.

Once you have that pools GUID, you can do zpool import $id oldtestpool. After the pool is imported, you can change the mountpoints so they don't overlap with the new testpool's mountpoints.

share|improve this answer
    
forgot to mention, once the import is complete, the old testpool pool will now be named oldtestpool. And can, as such be exported and imported as oldtestpool. –  Tim Kennedy Oct 24 '12 at 23:00
    
Thanks, this worked perfectly. –  cali-spc Oct 25 '12 at 17:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.