Williams225
asked on
SWAP FILE ERROR ON SOLARIS " may contain holes - can't swap on it"
hi, i just tried to create a swap file on a storage volume because i don't have enough space on my server. but i get error
"/swap_folder/swapfile" may contain holes - can't swap on it
the os is solaris. I took the procedure on the oracle website.
"/swap_folder/swapfile" may contain holes - can't swap on it
the os is solaris. I took the procedure on the oracle website.
# mkdir /swap_folder
create swap file
# mkfile -nv 100m /swap_folder/swapfile (100 megabyte swap file)
activate swap:
# swap -a /swap_edw/swapfile
edit vfstab:
# vi /etc/vfstab
ASKER
i also tried
mkfile -nv 100m /swap_folder/swapfile (100 megabyte swap file)
and
mkfile 100m /swap_folder/swapfile (100 megabyte swap file)
mkfile -nv 100m /swap_folder/swapfile (100 megabyte swap file)
and
mkfile 100m /swap_folder/swapfile (100 megabyte swap file)
What version of Solaris are you running? The -n option was supported on SunOS 4, but on SunOS 5 (Solaris 2) -n works only when the file is to be used by NFS. Local swap files cannot be created with the -n option.
ASKER
i use solaris 10. i also tried without the -n option , i had the same problem
This is pointing to a problem with the underlying file system. Can you copy the exact input and what is being outputed, so I can see exactly what you are seeing? What is the output of df -h
Try running fsck on the filesystem you are attempting to build the extra swap on.
ASKER
the partition where i am trying to create the swap is a partition on a storage
what type of stoarage a thumb drive, disk drive, fiber attached san storage, sas drive, ssd drive, sata, other?
swapfile has to be contiguous. In this case, the underlying filesystem does not have 100MB of contiguous free space.
Try creating a swap file on another filesystem with more free space.
Try creating a swap file on another filesystem with more free space.
That is a good point what size is the underlying file system. Although 100MB is not very large. If the inode information is incorrect it would likely cause this problem.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please check to make sure that it is not on a ZFS filesystem.
or try without -nv options
mkfile 100m /swap_folder/swapfile
or try without -nv options
mkfile 100m /swap_folder/swapfile
i think you enter the wrong path in the sawp -a command as you create new file "/swap_folder/swapfile" and you pass a file "/swap_edw/swapfile" to swap -a command, plz check again and feedback me.
ASKER