How to backup ZFS filesystems to files on USB drive?


 
Thread Tools Search this Thread
Operating Systems Solaris How to backup ZFS filesystems to files on USB drive?
# 8  
Old 02-13-2014
Still stuck at create zpool on USB drive to test archive

Hi DukeNuke2,
I have finally being able to create a recursive snapshot of all the filesystems using the following recommended command:

Code:
 
# zfs list -r rpool
# zfs snapshot -r rpool@001
# zfs send -R -p rpool@001 > /mnt/hostname_rpool@001.snapshot1

Where /mnt is the USB drive that is in UFS filesystem format. hostname_rpool@001.snapshot1 has been copied to /export/home and I need to get
the following guidance:
Code:
( i ) List table of content of this archive
      How to list the TOC of hostname_rpool@001.snapshot1?
( ii ) Create zpool called backups on the same USB drive
       zpool create backups c0t0d0s2 (USB)
       zpool create backups/usbdrive
       cannot mount 'backups/usbdrive': failed to create mountpoint
       filesystems successfully created, but not mounted
 
( iii ) Extract the content from this archive on to zpool backups
        cat hostname_rpool@001.snapshot1 | zfs recv -d backups/usbdrive

I am stuck in step ( ii ) and need confirmation on whether command in ( iii ) will work. Also like to confirm that compression has already been used
when creating the snapshot.
It's a very slow process and I can only do it with your valuable helps.
Thanks a lot,
George
# 9  
Old 02-13-2014
You are not compressing anything in the described procedure.

Creating an intermediary file (hostname_rpool@001.snapshot1) is an unnecessary step, you could (and should) directly pipe the "zfs send" command to a "zfs receive" one.

You are destroying your USB file system by creating a zfs pool on the very same device. Assuming you have no free partition on your USB disk, You need to create a file based pool.

There are also specific options you need to use to import a root pool as otherwise, some of the properties, especially mount points, will collide with your current root pool.
This User Gave Thanks to jlliagre For This Post:
# 10  
Old 02-13-2014
Need advice on create zpool on USB drive & retrieve archive

Hi jlliagre,

I have finally being able to create a recursive snapshot of all the filesystems using the following recommended command:

Code:
# zfs list -r rpool
# zfs snapshot -r rpool@001
# zfs send -R -p rpool@001 > /mnt/hostname_rpool@001.snapshot1

Where /mnt is the USB drive that is in UFS filesystem format. hostname_rpool@001.snapshot1 has been copied to /export/home and I need to get the following guidance:

Code:
( i ) List table of content of this archive
      How to list the TOC of hostname_rpool@001.snapshot1?
( ii ) Create zpool called backups on the same USB drive
       zpool create backups c0t0d0s2 (USB)
       zpool create backups/usbdrive
       cannot mount 'backups/usbdrive': failed to create mountpoint
       filesystems successfully created, but not mounted
       
( iii ) Extract the content from this archive on to zpool backups
        cat hostname_rpool@001.snapshot1 | zfs recv -d backups/usbdrive

I am stuck in step ( ii ) and need confirmation on whether command in ( iii ) will work. Also like to confirm that compression has already been used
when creating the snapshot.
It's a very slow process and I can only do it with your valuable helps.
Thanks a lot,
George
# 11  
Old 02-13-2014
Why are you posting the very same questions after I answered to them ?
# 12  
Old 02-14-2014
More clarification on command syntax to use

Hi jlliagre,

Sorry for posting the same questions twice since I panicked at the thought that my update was lost without realizing that it was on the next page.

I have already destroyed the UFS filesystem on USB drive with the following result which is fine:

Code:
# zfs list –r backups
NAME                         USED  AVAIL            REFER            MOUNTPOINT
backups                      131K   1.78T             31K               /mnt
backups/usbdrive              31K   1.78T             31K              /mnt/usbdrive
 
# zfs send –R –p rpool@001 | zfs recv –d backups/usbdrive


This is still going after running for more than 4hrs. My understanding is that this step will transfer a snapshot of all the data from local rpool & their datasets to backups zpool on USB drive. Is this correct? However, my intention has always been to create a snapshot of local rpool recursively into a single file with the following command:

Code:
# zfs send –R –p rpool@001 | zfs recv –d > /export/home/hostname_rpool@001.zdump

Is this command correct and how to include compression in the process as well? Also, how to list toc of /export/home/hostname_rpool@001.zdump after successful creation?

Thanks so much again,

George

Moderator's Comments:
Mod Comment Please use the standard font!

Last edited by DukeNuke2; 02-14-2014 at 10:01 AM..
# 13  
Old 02-14-2014
[QUOTE=gjackson123;302888413]
Code:
 
# zfs send -R -p rpool@001 | zfs recv -d backups/usbdrive

This is dubious, as I already wrote, you need specific options to import a root pool, at least a different root mountpoint.
Quote:
This is still going after running for more than 4hrs.
There are many factors that might affect the performance of such a command.
Quote:
My understanding is that this step will transfer a snapshot of all the data from local rpool & their datasets to backups zpool on USB drive. Is this correct?
Yes, but I suspect there will be errors because you'll end up with multiple file systems with the same mount point.

Quote:
However, my intention has always been to create a snapshot of local rpool recursively into a single file with the following command:

Code:
# zfs send -R -p rpool@001 | zfs recv -d > /export/home/hostname_rpool@001.zdump

Is this command correct
No. If you want to create a file, just redirect zfs send to it. This is what the link to the documentation I posted does.
Quote:
and how to include compression in the process as well?
You might just pipe through gzip.
Quote:
Also, how to list toc of /export/home/hostname_rpool@001.zdump after successful creation?
There is no way I'm aware of to list the content of such a datastream, moreover, as it usually contains volumes and snapshot, it won't be as stratforward as with a tar or cpio of ufsdump.
The only way to make sure a stored datastream is valid and list the files it contains is to extract (receive) it somewhere.
This User Gave Thanks to jlliagre For This Post:
# 14  
Old 02-15-2014
Couldn't mount /export during local OS bootup

Hi jlliagre,

I tried to boot up the local Solaris 10 x86 operating system instead of from installation disk all along but encountered the following error:

Code:
cannot mount ‘/export’: directory is not empty
svc:/system/filesystem/local:default:WARNING:/usr/sbin/zfs mount –a failed: exit status 1
Nov 15 10:50:17 svc.startd[10]:svc:/system/filesystem/local: default: Method “/lib/svc/method/fs-local” failed with exit status 95.
svc.startd[10]: system/filesystem/local: default failed fatally: transitioned to maintenance

The bootup process is running ‘zfs mount –a’ which generates the same error when running it manually (cannot mount ‘/export’: directory is not empty), but I don’t know which table (/etc/.../*tab?) that it is looking up to get ‘/export’ and yet I can see this filesystem has already been mounted using ‘df –h’ as follows:

Code:
 
rpool/export/home        228G   4.6M    204G   1%       /export/home
rpool                     228G     49K   204G   1%       /rpool

So I don’t understand where the issue is with mount /export which is preventing the system from booting into multi-user mode.

Not only have I not being able to create a zfs snapshot but appears to have disturbed possibly original mount point of local rpool as well.

Any idea on what to do?

Once again, I can only fix this issue with your persistent urgent advice.

Also, can I continue to generate zfs snapshot with zfs send -R -p rpool@001 > /mnt/usbdrive/hostname_rpool@001 once the system is running in multi-user mode? ie rpool is mounted.

Thanks in advance,

George

Moderator's Comments:
Mod Comment Use the standard font!

Last edited by DukeNuke2; 02-15-2014 at 07:53 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to take backup of ZFS file system on a tape drive?

Hi Guys, I want to take backup of a ZFS file system on tape drive. Can anybody help me with this? Thanks, Pras (0 Replies)
Discussion started by: prashant2507198
0 Replies

2. SuSE

In KDE Copy completed not always mean files were copied to USB flash drive - how to fix it?

I have noticed that when I copy files to flash disk and in UI I see message copy completed in notification area on task bar, usually copy is not completed. So, if I eject the media I loose data. It is very serious problem because may cause loss of valuable and even critical data. Moreover, when... (2 Replies)
Discussion started by: netwalker
2 Replies

3. Solaris

ZFS adding new filesystems to a non-global zone

Hi Guys I have one Global Zone and 2 non-global zones. root@solar109 # zoneadm list -icv ID NAME STATUS PATH BRAND IP 0 global running / native shared 20 solar109b running ... (1 Reply)
Discussion started by: fryzh
1 Replies

4. Solaris

Backup files to tape drive on solaris

Hi, I want to take backup of files older than 20 days from a directory onto a tape drive on remote machine on Solaris. The files are of format abc-20100301000000.gz on my local machine. I know the below commands for searching files older than x days and command for backup procedure. solar1 #... (7 Replies)
Discussion started by: jyothi_wipro
7 Replies

5. SCO

Complete backup of system spanning all filesystems

how would a make a complete backup of all files spanning all file systems on my SCO box to tape? i read somewhere: find . -print | cpio -ocv > /dev/rStp0 from / ... will this do it?? (yes /dev/rStp0 is my tape drive) (11 Replies)
Discussion started by: herot
11 Replies

6. Solaris

Adding and removing ZFS filesystems in Zones

I have a Solaris 10 container that is running on ZFS filesystems being presented from the Global Zone. I have a filesystem presented to the Local zone and my user wants me to remove it. It there any way I can remove this while the zone is running? I tried unmounting it from the local zone... (0 Replies)
Discussion started by: BG_JrAdmin
0 Replies

7. SCO

mounting USB floppy drive /Flash drive in OSR 6.0

Can anybody help me out to mount USB flash /floppy drive in sco openserver 6.0 . (5 Replies)
Discussion started by: sureshdrajan
5 Replies

8. Solaris

Jumpstart: creating zfs filesystems

Is it possible to create zfs pools and filesystems using the profile file in jumpstart? edit to add: using Solaris 10 Release 11/06 (1 Reply)
Discussion started by: dangral
1 Replies

9. Solaris

Solaris System State & filesystems backup

Hi , We are using Veritas Net Backup , I want to create a new policy for backing up the (Solaris Operating System & the file systems) only the OS. not Full backup because we have an other policy for Oracle Apps and it takes full backup for all Partitions. I need the OS backup to be in... (2 Replies)
Discussion started by: adel8483
2 Replies

10. UNIX for Dummies Questions & Answers

Accessing files on external USB drive using UNIX?

Hi Folks, I'm a serious UNIX newbie... I'm using a bash shell on Mac OS X. Basically I took up unix in order to use a specific image processing software package... I've learned enough to write a script to batch process all of my images, but I have so many that I would like to use an... (1 Reply)
Discussion started by: Slanter
1 Replies
Login or Register to Ask a Question