[SOLVED] cannot import pool after export

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

Re: cannot import pool after export

Postby maybeageek » Tue May 24, 2016 12:14 am

Brendon wrote:If you believe the output of diskutil list, disk3 appears to be HFS "Intenso1TB", although it is easy to have a disk that looks like that contain ZFS.

Yes, I believe diskutil list, as I reformatted disk 3 (Intenso1TB) to HFS.

Code: Select all
sh-3.2# zpool import -a
no pools available to import


Code: Select all
sh-3.2# zpool status
no pools available


Brendon: If you have any hope for my volume at all then I'd be happy, otherwise I would just start from scratch. The only thing that "hurts" is a virtual machine that was placed there, but I can re-install that server in like 30 minutes. So, the pain isn't that much, but I'd like to get to the ground of what happened.

Regards,
Thomas
maybeageek
 
Posts: 12
Joined: Fri Jul 31, 2015 3:17 am

Re: cannot import pool after export

Postby Brendon » Tue May 24, 2016 4:12 am

Hmmm..I see. Well you can't zfs send to an hfs drive. That explains my confusion seeing only a single zfs drive.

As for the pool, unless there is a magician out there it seems unlikely that you will recover it. However it would be worth understanding what happened to it, last thing I want is people believing export kills pools.

- Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: cannot import pool after export

Postby maybeageek » Tue May 24, 2016 4:18 am

Brendon wrote:Hmmm..I see. Well you can't zfs send to an hfs drive. That explains my confusion seeing only a single zfs drive.

As for the pool, unless there is a magician out there it seems unlikely that you will recover it. However it would be worth understanding what happened to it, last thing I want is people believing export kills pools.

- Brendon


yep, I know I cant zfs send to an HFS volume, but I needed it shortly.

I will dd zeros on both of them, recreate the exact steps I took before I exported the volume.

Question: The only thing I did about a week before I exported the volume and deleted the backup drive was to test zfs send | zfs recv a snapshot. After the test was successful I destroyed the receiving file system.

So the only thing I could imagine is somehow that zfs send | recv did something to the source drive as well?
But as I understood it the sending drive should be completely independent from the receiving one! Otherwise sending over SSH would make no sense, right?
maybeageek
 
Posts: 12
Joined: Fri Jul 31, 2015 3:17 am

Re: cannot import pool after export

Postby maybeageek » Tue May 24, 2016 10:58 am

Ok, after I started everything from scratch I can create snapshots, send and receive them, export, import pools.
So, everything works as it should. Whatever went wrong I don't know.

For anyone interested, this would be my backup script.
Code: Select all
#!/bin/bash
# ZFS Backup Script to backup one dataset on one disk on another

DATE=`date "+%Y-%m-%dT%H_%M_%S"`
#create a snapshot
zfs snapshot Intenso1TB/VMs@Backup-$DATE
# send it to the other disk
zfs send Intenso1TB/VMs@Backup-$DATE | zfs recv -F Backup1TB/B_VMs
# destroy the snapshot on the source disk
zfs destroy Intenso1TB/VMs@Backup-$DATE
maybeageek
 
Posts: 12
Joined: Fri Jul 31, 2015 3:17 am

Re: [SOLVED] cannot import pool after export

Postby Brendon » Tue May 24, 2016 1:57 pm

Thanks for that. To answer your question, sending a snapshot will not harm the source drive.

You could look into znapzend to take care of your backup needs.

- Brendon
Brendon
 
Posts: 286
Joined: Thu Mar 06, 2014 12:51 pm

Re: [SOLVED] cannot import pool after export

Postby maybeageek » Thu May 26, 2016 4:23 am

Brendon wrote:Thanks for that. To answer your question, sending a snapshot will not harm the source drive.

You could look into znapzend to take care of your backup needs.

- Brendon


Thanks for your help Brendon.

Znapzend does not work so well on OS X as I discovered?
However, I think I found a way to manage my snapshot needs:
Code: Select all
zfs list -H -t snap -o name -S creation | tail -n +14 | xargs -n 1 zfs destroy -r

With a script that runs hourly on weekdays and another that runs on Sunday, I can easily keep 2 weeks of daily snapshots and 1 month of weekly snapshots and so on.
maybeageek
 
Posts: 12
Joined: Fri Jul 31, 2015 3:17 am

Re: [SOLVED] cannot import pool after export

Postby stumble » Fri May 27, 2016 6:16 pm

I've been using this for months, and it works well:

https://github.com/zfsonlinux/zfs-auto-snapshot

I like your idea, though, because it's so simple.
stumble
 
Posts: 37
Joined: Thu May 15, 2014 7:05 pm

Re: [SOLVED] cannot import pool after export

Postby SmashedGecko » Tue Jun 28, 2016 8:07 pm

stumble wrote:I've been using this for months, and it works well:

https://github.com/zfsonlinux/zfs-auto-snapshot

I like your idea, though, because it's so simple.


I've had a look at zfs-auto-snapshot but just can't seem to get it to produce any snapshots.
Would you be able to run me through what you did to get it going? or point me to a guide?
SmashedGecko
 
Posts: 1
Joined: Tue Jun 28, 2016 8:01 pm

Re: [SOLVED] cannot import pool after export

Postby stumble » Tue Jun 28, 2016 9:29 pm

Ah: I've remembered that some versions of zfs-auto-snap don't work with O3X. Try this one:

http://bunny.xeny.net/temp/zfs-auto-snap
stumble
 
Posts: 37
Joined: Thu May 15, 2014 7:05 pm

Re: [SOLVED] cannot import pool after export

Postby stumble » Wed Jun 29, 2016 1:02 am

And then put this sort of thing in your crontab:

Code: Select all
*/5   *   *   *   *   sudo zfs-auto-snap bing/main frequent 12
0   *   *   *   *   sudo zfs-auto-snap bing/main hourly 24
1   9   *   *   *   sudo zfs-auto-snap bing/main daily 31
5   10   1   *   *   sudo zfs-auto-snap bing/main monthly 1000
6   9   *   *   *   sudo zfs-auto-snap bing/occasional daily 31
8   10   1   *   *   sudo zfs-auto-snap bing/occasional monthly 1000
3   10   1   *   *   sudo zfs-auto-snap bing/tamp monthly 1000
stumble
 
Posts: 37
Joined: Thu May 15, 2014 7:05 pm

Previous

Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 3 guests