Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

General Adjustments

  • Loading branch information...
commit 34ca473d4fc69d24e2e7a712613ed466164d1f33 1 parent f93613d
@umago authored
View
7 README.md
@@ -1,10 +1,9 @@
carbono
=======
-carbono is a small disk cloning tool which allows you to create
-and restore images of your complete hard disk or partition.
-Its also optimize the resulting image using tools to manipulate the
-filesystem and compacting the data blocks.
+carbono is a hard disk imaging and recovery application. Carbono
+optimize the resulting image saving and compacting only the used blocks in the
+hard disk. Multiprocessing is used to deal with performance problems.
Testing
-------
View
5 TODO
@@ -1,6 +1,5 @@
* GUI
-* Multicast
-* GPT
-* Plugin system
+* Multicast server
* Hook scripts (post-restore)
* Improve log system to log to network instead of file
+* Base System
View
4 carbono/buffer_manager/work_manager.py
@@ -37,7 +37,9 @@ def run(self):
self.event.set()
while self.event.is_set():
block_number, data = self.buffer.get()
- if data == EOF: break
+ if data == EOF:
+ self.stop()
+ break
worked_data = self.job(data)
while self.event.is_set():
View
12 carbono/image_creator.py
@@ -109,6 +109,8 @@ def create_image(self):
self.timer.start()
for part in partition_list:
+ if not self.active: break
+
log.info("Creating image of %s" % part.path)
number = part.get_number()
uuid = part.filesystem.uuid()
@@ -121,11 +123,11 @@ def create_image(self):
compressor = Compressor(self.compressor_level)
compact_callback = compressor.compact
- buffer_manager = BufferManagerFactory(part.filesystem.read_block,
+ self.buffer_manager = BufferManagerFactory(part.filesystem.read_block,
compact_callback)
- buffer_manager.start()
+ self.buffer_manager.start()
- buffer = buffer_manager.output_buffer
+ buffer = self.buffer_manager.output_buffer
volumes = 1
while self.active:
total_written = 0
@@ -154,7 +156,7 @@ def create_image(self):
fd.close()
if next_partition: break
- buffer_manager.join()
+ self.buffer_manager.join()
part.filesystem.close()
information.add_partition(number, uuid, type, volumes)
@@ -175,6 +177,8 @@ def create_image(self):
log.info("Creation finished")
def stop(self):
+ if self.active:
+ self.buffer_manager.stop()
self.active = False
self.timer.stop()
View
12 carbono/image_restorer.py
@@ -96,6 +96,8 @@ def restore_image(self):
self.timer.start()
partitions = information.get_partitions()
for part in partitions:
+ if not self.active: break
+
if information.get_image_is_disk():
partition = disk.get_partition_by_number(part.number, part.type)
else:
@@ -136,11 +138,11 @@ def restore_image(self):
compressor = Compressor(compressor_level)
extract_callback = compressor.extract
- buffer_manager = BufferManagerFactory(image_reader.read_block,
+ self.buffer_manager = BufferManagerFactory(image_reader.read_block,
extract_callback)
- buffer_manager.start()
+ self.buffer_manager.start()
- buffer = buffer_manager.output_buffer
+ buffer = self.buffer_manager.output_buffer
while self.active:
data = buffer.get()
if data == EOF:
@@ -148,7 +150,7 @@ def restore_image(self):
partition.filesystem.write_block(data)
self.processed_blocks += 1
- buffer_manager.join()
+ self.buffer_manager.join()
partition.filesystem.close()
self.stop()
@@ -156,6 +158,8 @@ def restore_image(self):
log.info("Restoration finished")
def stop(self):
+ if self.active:
+ self.buffer_manager.stop()
self.active = False
self.timer.stop()
Please sign in to comment.
Something went wrong with that request. Please try again.