# Changing nextflow work directory

**URL:** <https://community.seqera.io/t/changing-nextflow-work-directory/670>\
**Category:** Ask for help\
**Tags:** nextflow\
**Created:** [April 18, 2024, 3:45pm UTC](https://community.seqera.io/t/changing-nextflow-work-directory/670 "2024-04-18T15:45:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iman\_Nazari](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/iman_nazari/32/611_2.png) [@Iman\_Nazari](https://community.seqera.io/u/Iman_Nazari)\
**Post date:** [April 18, 2024, 3:45pm UTC](https://community.seqera.io/t/changing-nextflow-work-directory/670/1 "2024-04-18T15:45:21Z")

</div>

Hi Nextflow community,

i am running nextflow pipeline which is actually running process based on the apptainer image. i am getting this error regarding the read only file system. (it seems nextflow trying to create work directory inside $HOME wich is read only. or maybe im wrong? ). appreciate any helps regarding this iisue.

OSError: [Errno 30] Read-only file system: ‘/home/in1f24’

pipeline:  
process pre\_process1 {

```
    cache false
    input:
    file(p11)

    output:
    file("*")

    script:
    """
   
    CADD.sh -o ${params.output} ${p11} 
    
    """
}

```

// Define workflow  
workflow {

```
 data = channel.fromPath(params.p11)

// Pass the VCF file directly to the splitVCF process

 pre_process1(data)

```

#### config file

dag.enabled = true  
dag.overwrite = true  
apptainer.enabled = true  
apptainer.autoMounts = true  
apptainer.runOptions = “–bind /private”

params {

p11 = “chr22.p11.vcf”  
vcf = “jcjan24.merged.vcf.gz”  
output = “results”

cadd\_ = “genepy2\_cadd1.6\_vep111.sif”

}

process {  
withName:pre\_process1 {

```
    clusterOptions = '--nodes=1'
    cpus = 4
    memory = "4 GB"
    container = params.cadd_
    
}

```

}

}

---

<div class="post-metadata">

**Author:** ![Adam\_Talbot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/adam_talbot/32/62_2.png) [@Adam\_Talbot](https://community.seqera.io/u/Adam_Talbot)\
**Post date:** [April 18, 2024, 4:57pm UTC](https://community.seqera.io/t/changing-nextflow-work-directory/670/2 "2024-04-18T16:57:49Z")

</div>

Your example seems to be incomplete, could you share the full contents of the full workflow and configuration?

Nextflow uses a directory for storing assets at `NXF_HOME`, which is by default `$NXF_HOME/.nextflow/`, but it looks like your error is occurring within the process instead of where Nextflow is running, but I can’t tell from the example you have provided. It’s possible CADD writes to somewhere on the home directory while running, in which case we can reset the HOME variable to a different location while running. Here’s the configuration file:

```auto
env {
    HOME='$PWD'
}

```

And then your workflow, assuming it looks like this:

```nextflow
process pre_process1 {
    container "genepy2_cadd1.6_vep111.sif”

    cache false
    input:
    file(p11)

    output:
    file("output")

    script:
    """
    CADD.sh -o output ${p11} 
    """
}

workflow {
    data = channel.fromPath(params.p11)
    // Pass the VCF file directly to the splitVCF process
    pre_process1(data)
}

```

Of course this may not be the issue but it’s worth checking.

---

<div class="post-metadata">

**Author:** ![Iman\_Nazari](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/iman_nazari/32/611_2.png) [@Iman\_Nazari](https://community.seqera.io/u/Iman_Nazari)\
**Post date:** [April 22, 2024, 8:25am UTC](https://community.seqera.io/t/changing-nextflow-work-directory/670/3 "2024-04-22T08:25:07Z")

</div>

Yeap , solved. Thank you adam , that was the problem
