| Author |
Message |
hybinet
Joined: 02 May 2008
Posts: 31
|
| Posted: Fri May 02, 2008 11:18 pm Post subject: duplicate image |
|
|
Hi, just started using Linode yesterday, fantastic so far... :D
Quetion: will I get a corrupt copy if I duplicate my disk image while it's mounted ?
I like the way my ubuntu server is configured now, so I'd like to keep an exact copy of the root partition so I go back to it if I mess up later... and of course I have some free space to do that. But I'm not sure if I'll have to take my linode offline before duplicating my disk image. I found a few threads on related topics, but most of them are old so I'm not sure how things are with Xen servers....
Thx |
|
| Back to top |
|
pclissold
Joined: 24 Oct 2003
Posts: 462
Location: Netherlands
|
| Posted: Sat May 03, 2008 5:19 am Post subject: |
|
|
| You'll get a copy where open files are in undefined states - as if the machine had been suddenly powered off. If you are using a journalled filesystem, this shouldn't matter in theory, but the copy is not instantaneous like a power-down so the results are hard to predict. Since this will be the backup you rely on after the original has been trashed, play it safe and shut down while you duplicate. |
|
| Back to top |
|
chrisnolan
Joined: 02 Jun 2006
Posts: 15
|
| Posted: Sat May 03, 2008 8:34 am Post subject: |
|
|
following on from this...
how safe is it to resize one of my existing images (shrink it) so that I can make room for a duplicate image? |
|
| Back to top |
|
pclissold
Joined: 24 Oct 2003
Posts: 462
Location: Netherlands
|
| Posted: Sat May 03, 2008 9:24 am Post subject: |
|
|
chrisnolan wrote: how safe is it to resize one of my existing images (shrink it) so that I can make room for a duplicate image?
Resize has always worked OK for me - but something like a power outage halfway through the operation could screw it up. Run your offsite backup first. |
|
| Back to top |
|
hybinet
Joined: 02 May 2008
Posts: 31
|
| Posted: Sat May 03, 2008 8:10 pm Post subject: |
|
|
| Thanks for your explanation, pclissold |
|
| Back to top |
|
bdonlan
Joined: 22 Jan 2008
Posts: 59
|
| Posted: Tue May 06, 2008 1:43 pm Post subject: |
|
|
pclissold wrote: You'll get a copy where open files are in undefined states - as if the machine had been suddenly powered off. If you are using a journalled filesystem, this shouldn't matter in theory, but the copy is not instantaneous like a power-down so the results are hard to predict. Since this will be the backup you rely on after the original has been trashed, play it safe and shut down while you duplicate.
No, this is not the same as a sudden poweroff. Since the linode is modifying the filesystem at the same time, you can (and probably will) end up with massive corruption - and your journal will only make things worse, as the kernel might not notice the corruption until it's already made it worse. If for some reason such a thing was /absolutely necessary/ for some insane reason:
* Quiesce the source filesystem as much as possible first
* Copy the fs
* Forcibly remove the journal from the copy with debugfs
* Run e2fsck -f
* Pray (but don't get your hopes up)
In order for the copy to truly be sound, it absolutely needs to be made atomically. |
|
| Back to top |
|
| |