Extract RAR Files from Read-Only Discs with Unrar

Extracting RAR archives directly from read-only optical media such as CDs, DVDs, or Blu-ray discs requires understanding how unrar manages file operations and write permissions. Because optical filesystems like ISO 9660 and UDF enforce strict read-only access, unrar can read the archive's internal structure and data blocks without issue, but it cannot write extracted files back to the source directory. Successfully extracting these archives requires defining an external, writable target destination on a local storage drive.

Read-Only Handling and File Access

The unrar utility does not modify the source archive during standard decompression. When processing files stored on an optical drive, unrar executes read and seek system calls to parse the archive headers, file tables, and compressed data streams. Because no temporary lock files or inline modifications are made to the archive itself, the read-only flag of the underlying disc does not impede the decompression engine.

The Default Extraction Conflict

By default, executing unrar e archive.rar or unrar x archive.rar attempts to extract contents into the current working directory. If a terminal or file manager executes this command with the working directory set to the mounted optical drive path (for example, /media/cdrom/ on Linux or D:\ on Windows), the operation will immediately fail. The system will return a write error such as:

Cannot create ... Permission denied or Write error: access denied

The error does not mean unrar cannot read the disc; it means the operating system is rejecting unrar's attempt to create output files on a non-writable filesystem.

Executing Extractions to a Writable Destination

To extract files from optical media without errors, you must designate a writable local path as the output directory. This can be accomplished in two ways:

  1. Explicit Target Path Syntax: Supply the full path to the archive on the disc, followed by the target destination folder on your local drive:
    unrar x /media/cdrom/archive.rar /home/user/extracted_files/
  2. Current Directory Redirection: Navigate to a writable local folder first, then call unrar pointing to the optical media:
    cd /home/user/extracted_files/
    unrar x /media/cdrom/archive.rar

Handling Multi-Volume Sets Across Multiple Discs

RAR archives that span across multiple optical discs (split volumes such as .part1.rar, .part2.rar) are handled smoothly by unrar.

When the extraction process reaches the end of the data stored on the first disc, unrar pauses and prompts the user to locate the next volume. At this stage, the user can either eject the optical disc, insert the next medium, and press enter to continue, or specify an updated file path where the subsequent volume is mounted. Because unrar does not cache files on the source media, swapping read-only discs does not disrupt the ongoing extraction stream targeting the local disk.

File Attributes and Permissions

When extracting archives created on other platforms, RAR archives often preserve original file permissions and read-only attributes. If an archived file itself was flagged as read-only when the archive was authored, unrar will apply that read-only attribute to the newly created file on the destination disk. This behavior is governed entirely by the archive metadata, independent of the physical optical media. You can override attribute restoration by passing flags such as -ow- (to exclude file security information) depending on your administrative requirements.