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?
# 1  
Old 02-11-2014
How to backup ZFS filesystems to files on USB drive?

Dear Solaris 10 Experts,
I need to carry out a manual backup of all zpool/zfs filesystems on a Solaris 10 x86 server in order to port it onto VM Ware hardware but don't know how
to do it. Past exercises have been smooth using ufsdump & ufsrestore for small standalone servers. Below are the zfs filesystems that need to be backed up:

Code:
 
rpool/ROOT/ibm_srs_2 228G 6.6G 208G 4% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 7.1G 1.0M 7.1G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
sharefs 0K 0K 0K 0% /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap2.so.1
215G 6.6G 208G 4% /lib/libc.so.1
fd 0K 0K 0K 0% /dev/fd
rpool/ROOT/ibm_srs_2/var
228G 3.4G 208G 2% /var
swap 7.1G 2.0M 7.1G 1% /tmp
swap 7.1G 828K 7.1G 1% /var/run
rpool/export 228G 32K 208G 1% /export
rpool/export/home 228G 4.6M 208G 1% /export/home
rpool 228G 49K 208G 1% /rpool

I am very to ZFS and having been Googling but could not find a simple straigt forward commands to backup ZFS filesystems into files onto external USB
drive to be transfer to VM Ware server for hardware migration purposes.
Your advice / referral would be very much appreciated.
Many thanks,
George
# 2  
Old 02-11-2014
This User Gave Thanks to DukeNuke2 For This Post:
# 3  
Old 02-11-2014
Clarification on zfs send syntax

Thank you to Soulman for offering your referral,

What is the zfs send syntax to backup the following filesystems followed by compression:

Code:
rpool/ROOT/ibm_srs_2 228G 6.6G 208G 4% /
zfs send rpool/ROOT/ibm_srs_2 | gzip > rpool_ROOT_ibm_srs_2.gz?

/usr/lib/libc/libc_hwcap2.so.1 215G 6.6G 208G 4% /lib/libc.so.1
zfs send /usr/lib/libc/libc_hwcap2.so.1 | gzip > usr_lib_libc_libc_hwcap2.so.1.gz?

rpool/ROOT/ibm_srs_2/var     228G 3.4G 208G 2% /var
zfs send rpool/ROOT/ibm_srs_2/var | gzip > rpool_ROOT_ibm_srs_2_var.gz?

rpool/export 228G 32K 208G 1% /export
zfs send rpool/export | gzip > rpool_expert.gz?
 
rpool/export/home 228G 4.6M 208G 1% /export/home
zfs send rpool/export/home | gzip > rpool_export_home.gz?

rpool 228G 49K 208G 1% /rpool
zfs send rpool | gzip > rpool.gz?

Thanks again,

George

Last edited by Don Cragun; 02-12-2014 at 04:38 AM.. Reason: Add CODE tags.
# 4  
Old 02-11-2014
Well, I don't understand the question?! As far as I can see the provided document contains all the needed information?!

Sending and Receiving ZFS Data - Oracle Solaris ZFS Administration Guide
This User Gave Thanks to DukeNuke2 For This Post:
# 5  
Old 02-11-2014
Some comments:

No need to backup libc_hwcap2.so.1 which isn't a zfs file system anyway.

You need to create a snapshot before sending datasets.

Instead of sending each file system separately, send recursively from the top dataset (and create a recursive snapshot to ensure consistency).

Instead of sending to a local file, send the stream to another machine where you run "zfs receive". This will guarantee the backup wasn't corrupted during the transport.

If you want to compress your data, use ZFS own compression capabilities instead of relying of an external gzip command.

If you are short on network bandwidth, you might compress the datastream before sending it but you'll need to uncompress it on the other side before receiving it.

Use incremental send/receive for subsequent backups.
This User Gave Thanks to jlliagre For This Post:
# 6  
Old 02-12-2014
Provide more specific examples please

Hi jlliagre,

Thanks for your general advice but I would very much appreciate for more specific commands. Below are the things that I have tried but still a long way to getting a proper backup onto USB (UFS filesystem) currently, while in single user mode:

Code:
# Create recursive snapshot of local zpool called rpool
zfs snapshot -r rpool@001
# Want to create an archived zfs backup file with compression on USB
# drive mounted on mnt folder
zfs send -p rpool@001 > /mnt/hostname_rpool@001.snapshot1

Which returns the prompt immediately with only a tiny file generated. Alternatively solution is to use the following command to create snapshot on to the USB drive with zfs receive:

Code:
zfs send -p rpool@001 | zfs recv -d mnt

However, do I need to create a zpool filesystem on USB drive first? How to do that and also the drive is currently in UFS format? Don't tell me that I need to slice up the USB or re-create it in zfs filesystem.

ZFS backup is much more complex than ufsdump/ufsrestore in the past. I simply want a physical backup file of everything under rpool that can be transfered to another generic Solaris 10 VM, to be restored onto.

Much appreciate your detail comments & patience.

George
Moderator's Comments:
Mod Comment Please use CODE tags when posting sample code, input, and output rather than assume than an administrator will edit your posts to add missing tags.

Last edited by Don Cragun; 02-12-2014 at 04:41 AM.. Reason: Add CODE tags.
# 7  
Old 02-12-2014
Quote:
Originally Posted by gjackson123
Code:
# Want to create an archived zfs backup file with compression on USB
# drive mounted on mnt folder
zfs send -p rpool@001 > /mnt/hostname_rpool@001.snapshot1

Which returns the prompt immediately with only a tiny file generated.
You are missing the zfs send -R option.

Have look to the ZFS administration guide for a root pool backup and restore example.
These 2 Users Gave Thanks to jlliagre For This Post:
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

Featured Tech Videos