    def store_os_image(self, name: str, data: bytes, chunk_size: int = 1024 * 1024) -> str:
        """Store OS image in chunks"""
        image_id = hashlib.sha256(f"{name}_{time.time()}".encode()).hexdigest()
        checksum = hashlib.sha256(data).hexdigest()
        total_size = len(data)
        
        with self.lock:
            # Store image metadata
            self.conn.execute("""
                INSERT INTO os_images (id, name, size, checksum, created_at)
                VALUES (?, ?, ?, ?, ?)
            """, (image_id, name, total_size, checksum, time.time()))
            
            # Store image data in chunks
            for i in range(0, total_size, chunk_size):
                chunk = data[i:i + chunk_size]
                chunk_id = hashlib.sha256(f"{image_id}_{i}".encode()).hexdigest()
                self.conn.execute("""
                    INSERT INTO os_image_chunks (chunk_id, image_id, chunk_index, data, chunk_size)
                    VALUES (?, ?, ?, ?, ?)
                """, (chunk_id, image_id, i // chunk_size, chunk, len(chunk)))
            
            self.conn.commit()
        
        return image_id

    def store_os_image_chunk(self, image_id: str, chunk_index: int, data: bytes):
        """Store a chunk of OS image"""
        chunk_id = hashlib.sha256(f"{image_id}_{chunk_index}".encode()).hexdigest()
        
        with self.lock:
            self.conn.execute("""
                INSERT INTO os_image_chunks (chunk_id, image_id, chunk_index, data, chunk_size)
                VALUES (?, ?, ?, ?, ?)
            """, (chunk_id, image_id, chunk_index, data, len(data)))
            self.conn.commit()

    def get_os_image(self, image_id: str) -> Optional[bytes]:
        """Retrieve full OS image"""
        with self.lock:
            # Check if image exists
            image = self.conn.execute("""
                SELECT size FROM os_images WHERE id = ?
            """, (image_id,)).fetchone()
            
            if not image:
                return None
                
            # Get all chunks in order
            chunks = self.conn.execute("""
                SELECT data FROM os_image_chunks 
                WHERE image_id = ? 
                ORDER BY chunk_index
            """, (image_id,)).fetchall()
            
            # Combine chunks
            return b''.join(chunk[0] for chunk in chunks)

    def get_os_image_info(self, image_id: str) -> Optional[Dict[str, Any]]:
        """Get OS image metadata"""
        with self.lock:
            result = self.conn.execute("""
                SELECT name, size, checksum, created_at 
                FROM os_images WHERE id = ?
            """, (image_id,)).fetchone()
            
            if result:
                return {
                    'id': image_id,
                    'name': result[0],
                    'size': result[1],
                    'checksum': result[2],
                    'created_at': result[3]
                }
            return None

    def list_os_images(self) -> List[Dict[str, Any]]:
        """List all stored OS images"""
        with self.lock:
            results = self.conn.execute("""
                SELECT id, name, size, checksum, created_at 
                FROM os_images 
                ORDER BY created_at DESC
            """).fetchall()
            
            return [{
                'id': row[0],
                'name': row[1],
                'size': row[2],
                'checksum': row[3],
                'created_at': row[4]
            } for row in results]