The real layout of the memory is called the physical memory. The memory 'seen' by a particular process is called the logical memory.
Most modern CPU's incorporate a device called a Memory Management Unit that translates from logical to physical addresses.
A major problem with this system is that files cannot grow in size unless other files are moved.
Another problem with contiguous allocation is that if files are deleted, the disk will have gaps between files.
If file2 and file4 are now deleted, the disk will look like:
When a file is created, the operating system must look through a list of the gaps to see if there is one large enough. The disk may have enough space left on it for the file, but if the space is scattered over many gaps then file creation will fail.
A better system is called indexed allocation.
The hard disk is divided into small chunks called blocks or clusters. Block sizes vary between 512 bytes and 64K bytes.
At a fixed position on the disk, is a table that keeps track of which block is allocated to which file. The following diagram shows how file6 is stored at two different places on the disk. Indexed allocation allows files to grow in size and makes good use of disk space if the block size is small. If the block size is large then space will be wasted in partially filled blocks.