partitioning - Does swap space have a filesystem? - Ask Ubuntu


for working storage devices need file system, swap space?

if doesn't have file system how operating system work it? how data (from ram) written disk, , how accessed again?

swap technically doesn't have specific filesystem. whole purpose of filesystem structure data in way. swap partition in particular doesn't have structure, have specific header, created mkswap program. in particular , (taken kernel.org):

 25 union swap_header {  26     struct   27     {  28         char reserved[page_size - 10];  29         char magic[10];  30     } magic;  31     struct   32     {  33         char     bootbits[1024];  34         unsigned int version;  35         unsigned int last_page;  36         unsigned int nr_badpages;  37         unsigned int padding[125];  38         unsigned int badpages[1];  39     } info;  40 }; 

each partition has specific code associated it, , according tldp:

code ext2 0x83 , linux swap 0x82

when swap file involved, that's different story. kernel must respect fact filesystem may have own way of structuring data. same kernel.org link:

remember filesystems may have own method of storing files , disk , not simple swap partition information may written directly disk. if backing storage partition, 1 page-sized block requires io , there no filesystem involved, bmap() unnecessary.

in conclusion, technically call swap space filesystem of own type, it's not quite comparable filesystems ntfs or ext4

you've asked

i want know how possible write in storage space without file system

strictly speaking, there's no need ram structured. however, portions of ram can structured tmpfs under unix-like oses. there's ramfs, , initramfs , gets loaded during boot process. ram data technically supposed raw 1s , 0s, there's no need structure them in anyway.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User