creatubg a swao-file: Once we have the file is created, do i need to set permission?


Results 1 to 2 of 2

Thread: creatubg a swao-file: Once we have the file is created, do i need to set permission?

  1. #1
    Join Date
    Nov 2024
    Posts
    82

    creatubg a swao-file: Once we have the file is created, do i need to set permission?

    good evening dear friends hello dear buddies at JustLinux,


    well at the moment i want to create a swap-file for my linux notebook


    i have learned that - before creating the file, i need to ensure that i have enough free disk space to complete the whole process successfully.
    that said - i should get a kind of a detailed report on the system?s disk space usage with the df command:



    Code:
    df -h

    Here, the root filesystem (/) has enough free space (53G) to create the file.

    this way i get some insights into the data - consisting of the following categories:

    Code:
    Filesystem                         Size  Used Avail Use% Mounted on

    the nextg step is to create a file that will be used as a swap:

    Code:
    sudo fallocate -l 8G /swap.img

    hopefully the fallocate utility is present on the system,


    Code:
    sudo dd if=/dev/zero of=/swap.img bs=1024 count=8194404
    Question: Once we have the file being created, do i need to set the file permissions to 600


    is this necessary!?


    Any and all help is greatly appreciated

    greetings

  2. #2
    Join Date
    May 2002
    Posts
    1,291
    From what I have read you want to use dd solely and not fallocate. fallocate does not guarantee a contiguous file.

    Yes you need to set permissions to 600.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •