Back up and restore ZFS file systems

  • Permalink
  • submit to reddit
  • Email
  • Follow


I wrote two scripts zfsdumpd.sh and zfsrestored.sh to back up and
restore ZFS.  They are handy especially when a system has many ZFSs.
The script can back up and restore all of ZFSs at one time.

http://www.sun.com/bigadmin/content/submitted/zfsdumpd_zfsrestored.jsp

Victor

0
Reply victorfeng1973 (44) 11/1/2007 1:11:30 PM

See related articles to this posting


Those scripts look useful.

FYI:  Might also be interested in Tim Foster's automatic ZFS snapshot
scripts:
http://blogs.sun.com/timf/entry/zfs_automatic_snapshots_0_8

One problem I encountered when taking snapshots of large filesystems
(>100G) is described in this bug report:
http://bugs.opensolaris.org/view_bug.do?bug_id=6509628

The above bug is listed as fixed in a Nevada build but I am running
Solaris 10 update 3 (11/06) and experienced it.
I don't know if it is corrected in s10u4 (8/07) release.

The problem was destroying a snapshot, which is supposed to be fast,
was taking hours as well as using 100% of a CPU.
There is a workaround described in the above bug report which is to
make my current working directory to be inside the filesystem which
was snapshotted, then trying to unmount it  The umount will fail
(because the filesystem is in use due to it being my working
directory, if not for other reasons.)  But, the side effect is that it
will somehow let the snapshot be destroyed in a reasonable amount of
time (a few seconds) and without the CPU looping.

But, a bad side effect of the workaround I have noticed and which is
not reported in the above bug is that if the filesystem which was
snapshotted is shared by NFS, it becomes unshared as a result of the
attempted umount.  That is, even though the umount fails, it causes
the filesystem to be unshared (as if "zfs unshare ..." was run on the
filesystem.)  So, it is necessary to run "zfs share ..." after the
umount in order for NFS to continue working.

0
Reply Doug 11/1/2007 8:23:00 PM

On Nov 1, 3:23 pm, Doug <dy2...@gmail.com> wrote:
> Those scripts look useful.
>
> FYI:  Might also be interested in Tim Foster's automatic ZFS snapshot
> scripts:http://blogs.sun.com/timf/entry/zfs_automatic_snapshots_0_8
>
> One problem I encountered when taking snapshots of large filesystems
> (>100G) is described in this bug report:http://bugs.opensolaris.org/view_bug.do?bug_id=6509628
>
> The above bug is listed as fixed in a Nevada build but I am running
> Solaris 10 update 3 (11/06) and experienced it.
> I don't know if it is corrected in s10u4 (8/07) release.
>
> The problem was destroying a snapshot, which is supposed to be fast,
> was taking hours as well as using 100% of a CPU.
> There is a workaround described in the above bug report which is to
> make my current working directory to be inside the filesystem which
> was snapshotted, then trying to unmount it  The umount will fail
> (because the filesystem is in use due to it being my working
> directory, if not for other reasons.)  But, the side effect is that it
> will somehow let the snapshot be destroyed in a reasonable amount of
> time (a few seconds) and without the CPU looping.
>
> But, a bad side effect of the workaround I have noticed and which is
> not reported in the above bug is that if the filesystem which was
> snapshotted is shared by NFS, it becomes unshared as a result of the
> attempted umount.  That is, even though the umount fails, it causes
> the filesystem to be unshared (as if "zfs unshare ..." was run on the
> filesystem.)  So, it is necessary to run "zfs share ..." after the
> umount in order for NFS to continue working.


Good to know! I'll try it out too.

Victor

0
Reply victorfeng1973 11/1/2007 9:04:28 PM
comp.unix.solaris 25792 articles. 87 followers. Post

2 Replies
553 Views

Similar Articles

[PageSpeed] 55


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Can ufsrestore restore files to a ZFS file system?
I have a Sun Blade 2000 running Solaris 10 update 5 which is fitted with a pair of 137 GB FC-AL disks. One of the disks is used as /export/home and has only one UFS file system on it. I have created a level 0 dump of this file system using ufsdump and saved it to a file which I've stored in a ZFS pool created with a pair of 1 TB USB disks. Can I destroy the data on the UFS file system, create a ZFS pool on that disk, then restore the data from a file created with ufsdump? (The file is stored on a mirrored pair of 1 TB USB disks). The fact the command has *ufs* in the name rather s...

Live Upgrade to Migrate a UFS Root File System to a ZFS Root File System
I'm trying to update a machine running Solaris 10 update 4 with a UFS root file system to one running Solaris 10 update 7 with a ZFS boot file system. I've looked at http://docs.sun.com/app/docs/doc/819-5461/ggrkz?a=view The example uses the syntax: # lucreate -c ufs509BE -n zfs509BE -p mpool done what it said and created a ZFS storage pool with a a slice. But any attempt to use the above example fails, as lucreate does not appear to support the -p option on Solaris 10 update 4. root@t2 # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT root...

How to update system with ZFS file systems.
I've got a Sun Blade 2000, with Solaris 10 update 4 on it. Some time back I tried to do a live update, and it failed for some reason - cant recall which. Anyway, I am just downloading Solaris 10 update 6 and will do an update (but not live update). My slight concern is with the disks which have ZFS file systems on them. I assume the update process will detect these, but I'd like to be sure and have the least hassle in recovering if things got wrong. The system is set up like this: bash-3.00$ df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t1d0s0 ...

How the hell do I delete files on ZFS when file system is full?
I've got a problem on a Sun Blade 2000 running Solaris 10 update 7 with ZFS file systems. One of the file systems is full, but when I try to remove a file, I get: # rm 3.ini rm: 3.ini not removed: no space left on device This is happening in single user mode too. I've tried deleting the smallest file I could, in the hope that any disk space the deletion uses would be minimal. But I still can't remove the file. I even found a file of 0 bytes in length on the disk, but that too could not be deleted. Short of drilling a hole in one of the platters of the disk, how can I remove fil...

Restoring file systems
Some days ago I installed Windows 2000 (I use Windows occasionally for games and midi keyboard purposes, and thought I should get a version that hasn't made me want to strangle myself). While installing drivers, I got a blue screen telling me it was dumping core. After it rebooted, one of my FAT32 partitions had gone apeshit. All the files were there, but most of them[1] had been assigned a hex number instead of a normal file name, and they won't open. Actually, Nautilus crashes if I try to enter the folders. Windows calls them file fragments. I've successfully opened some pictures...

ZFS file system
Silently dropped from Snow Leopard server. Once one of the advertised features, all mention of it has been removed from the Snow Leopard server features page. I remember the uproar when Vista dropped WinFS (which no one seemed to know what it was or why we needed it, but they were outraged anyways). Steve In article <6LmdnaG-l-mwNbPXnZ2dnUVZ_v2dnZ2d@giganews.com>, Steve de Mena <steve@stevedemena.com> wrote: > Silently dropped from Snow Leopard server. Once one of the advertised > features, all mention of it has been removed from the Snow Leopard > server featu...

File System Restore
I'm running the latest version of PostgreSQL. I backed up one of my databases following the instructions in the postgresql documentation. This means that I did shut down postmaster and I tarred the data directory just like it says to. Now, I'd like to restore the file system. I started by just copying the data directory back, but that hasn't worked for me. Can somebody please give me some detailed directions on restoring the file system correctly. I think the only thing that is different about this new install of postgresql is that it is owned by a different u...

Loop back file system
Hello, In Linux there are some devices like /dev/loop1, ... that allows to create a (big) file and after to mount and use it like a "virtual" disk. Knows someone if there are something similar in Solaris 2.8? Thanks a lot. tmp123 wrote: > In Linux there are some devices like /dev/loop1, ... that allows to > create a (big) file and after to mount and use it like a "virtual" > disk. > > Knows someone if there are something similar in Solaris 2.8? That sounds like lofiadm(1m). Gavin Yes, it is. Thanks a lot for your help (fast, brief and exact. Imposs...

How to install ZFS file system
I'm trying to install ZFS file system. Please guide me Need help urgently regards... Sunny Sunny Anthony wrote: > I'm trying to install ZFS file system. > Please guide me > Need help urgently > > regards... > Sunny > You need Solaris "Nevada" to do that. # uname -a ... 5.11 ... If you have a uname -a with "5.10" (or older) ZFS isn't available for on that version. Try: http://www.sun.com/software/solaris/solaris-express/get.jsp ...

ZFS file system limits
Currently this is a theoretical question, I'm just trying to get a feel for the reasonable limits :-) Suppose you have a X4500 and 30,000 potential users each with a private ZFS area managed with quotas. Is it reasonable to allow ZFS to mount 30K file systems at boot time or would it be better to put the user file systems under automounter control? There would probably not be more than 5,000 users active at any one time. Thanks, -- Geoff Lane, Airstrip One news@buffy.sighup.org.uk wrote: > Currently this is a theoretical question, I'm just trying to get a feel for > th...

Zones on ZFS file system.
Consider the following Server A (Solaris 11 x86) has lots of disk space (ZFS file systems) and shares file systems via NFS to client's B, C, D etc. One wants to create zones on client B (Solaris 10, SPARC), which have access to the NFS shared directories on the server. Is this a good idea? I'm thinking the whole point of a zone is to give isolation, so allowing read/write access to a file system shared via NFS from another machine is not a good idea. Any thoughts? -- I respectfully request that this message is not archived by companies as unscrupulous as 'Experts Exchan...

ZFS File System Query
Duhhhh. It's stupid question time. ZFS checksums everything it writes to disc, which is great for data integrity. Will the checksumming slow down write times a bit? A lot? On 2006-12-21 18:48:01 -0800, OldCSMAer <olddog@kennels.NOSPAM.com> said: > Duhhhh. It's stupid question time. ZFS checksums everything it writes > to disc, which is great for data integrity. > Will the checksumming slow down write times a bit? A lot? No. Generating the checksums will cause a negligble amount of additional CPU load, but the speed of disk writes is limited by the physics o...

List backed by file system
Hi, I have a data structure that is currently implemented using the List interface. My data consists of a collection of Objects ordered within a list. I will soon start running into memory problems, so I need to cache this all to disk. Ideally I would have a List implementation that reads and writes to 1 or more files instead of holding the data in memory. The methods I require are get( int ), add( Object ), add( int, Object ). Most of the time I will be appending data, but I may also insert using add( int, Object ). Is there a library somewhere that I can reuse? I'm not looking for an e...

User Files Not Loading After System Restore
I'm using Dragon Naturally Speaking 8, and seem to have lost my user files after using system restore. the program simply can't load them any more, although I understand that they might be saved and retrievable. can you please help me find them and indicate what I might need to do to retrieve previously saved files? thanks in advance idol_wild@hotmail.com wrote: > I'm using Dragon Naturally Speaking 8, and seem to have lost my user > files after using system restore. the program simply can't load them > any more, although I understand that they might be saved and &...

ZFS file system and OS X
Anyone hear about this? I didn't see any thing posted here. Sounds like a Good Thing. What do you think? http://www.macosrumors.com/ "Apple is reportedly interested in porting Sun's Solaris "ZFS" filesystem to Mac OS X, and is seeking community assistance -- the ZFS team at Sun is reportedly pleased and fully supports the effort being spearheaded by Chris Emura, Apple's Filesystem Development Manager." http://www.opensolaris.org/os/community/zfs/ Andy In article <e35uff$idt$1@reader01.news.esat.net>, sav <notthisbitsavage@tamperelainen.org> wro...

zfs mounting root but not the other file systems
I've installed CURRENT onto an older disk, and have a set of 3x1.5T baracuda drives for a raidz array. Creating the additional filesystems, setting mountpoints, and populating with the files from the bootstrap system was straitforward with the directions at https://www.ish.com.au/solutions/articles/freebsdzfs . I have zfs_enable="YES" in /etc/rc.conf, and zfs_load="YES" and vfs.root.mountfrom="zfs:tank/root" in /boot/loader.conf. (/boot is actually a symlink to the bootstrap disk installation). When I boot, though, the two filesystems specified ...

Back up entire system to one file
Hello! I want to back up my whole linux system: All partitions, all files, everthing, into just one file. I want it in such a way that I can just unpack this file and get my files and partiton layout and everything back. In short, I want what Symantic Ghost gives windows, but on linux. (NOTE: I don't have Ghost so I haven't tried that one.) People tell me its possible, but no one will tell me how. Thanks for your help! ~John C. On 20 Nov 2003 12:41:30 -0800, johnlinford@mail.weber.edu (John C. Linford) wrote: > I want to back up my whole linux system: ...

File system in battery backed SRAM
I have a system with a region of memory that is battery-backed. I'd like to use it as a file system - the idea is to make / read only and put files that need to be modified into the battery backed file system.... I've googled about but found nothing that would do this; just some vague references to ramdisks. But then I've found nothing that would let me pin a ramdisk into a specific region in memory and keep it there over reboots. So... Anyone know of any way to do this? Thanks... Wath about adding a hard disk, mmc or SD ? Captain Dondo wrote: > I ha...

Backing up and restoring system HELP
Someone in another department is asking for my help with a 5 year old setup of SCO 5.0.5 release 3.2 running on a pc. I don't work with SCO so I know nothing about it, other than that most Unix commands I know seem to work on it. The problem is this: They have a failover setup, of which one server of two is now dead. They have no tape backups at all. When I go to make a backup of the one still good machine to the tape drive in their system, it tells me the device rStp0 is offline. This system supposedly is not to be shutdown for more than 30 seconds a pop, so getting another tape drive to...

Backing up "non-system" files only?
I'm planning to do daily scheduled Retrospect backups (Retrospect Duplicates, actually) of all the files on my iBook G4 HD that are "non-system files"��that is, all the files and folders that are files of mine, or at least files I get to see or modify �� more than just the Documents folder and including things like the Applications and Library folders, but omitting all the more mysterious hidden system stuff that I'm never supposed to even see, much less touch. (Reason is primarily just to simplify and speed up the backups; I also do a less frequent Carbon Copy Clon...

ZFS new file system & Linux
ZFS is a 128-bit file system. Apple is thinking about using it in upcoming OS X. Can it be used with Linux. If the answer is yes, then can we format our current hard-drive with it? Reference: http://opensolaris.org/os/community/zfs/ http://en.wikipedia.org/wiki/Zfs pcutilisateur@gmail.com did eloquently scribble: > ZFS is a 128-bit file system. Apple is thinking about using it in > upcoming OS X. Can it be used with Linux. If the answer is yes, then > can we format our current hard-drive with it? So, what benefit would one gain? (Unless you were hosting an incredibly large disk...

Restore Accounts with greater than 32K files on system
I was wondering if some could help with my problem. NT and D3 714, over 32K files I have been saving to a pseudo file the backup of over 50 accounts that contain roughly 2000 files each. All the accounts have the same named files in them. I made a full save and ran a /fileload to start reloading only the active accounts and defrag while I was at it. I've reloaded approximately 15 accounts and then no more accounts can be reloaded. But after a point in the backup all the accounts and files that I'm trying to reload all scrolls down the screen with the error in the following fo...

zfs mounting root but not the other file systems #2
[original superceded as I found more] I've installed CURRENT onto an older disk, and have a set of 3x1.5T baracuda drives for a raidz array. Creating the additional filesystems, setting mountpoints, and populating with the files from the bootstrap system was straitforward with the directions at https://www.ish.com.au/solutions/articles/freebsdzfs . (hmm, but they seem to be empty) I have zfs_enable="YES" in /etc/rc.conf, and zfs_load="YES" and vfs.root.mountfrom="zfs:tank/root" in /boot/loader.conf. (/boot is actually a symlink to the bootstr...

ZFS File System on the Compact Flash card
Hi All, I'd like to mount ZFS File System on the Compact Flash card. Does anyone know whether there is ZFS VxWorks driver that supports Compact Flash ? Thx jaz ...