# tar -C /mnt/source -cf - . | tar -C /mnt/target xvf -



## balanga (Apr 21, 2017)

I wanted to use a smaller partition for my FreeBSD installation and came across this 'howto' on the FreeBSD mailing list

https://lists.freebsd.org/pipermail/freebsd-questions/2008-September/182394.html

In Part 7 it says to copy, via tar, from one mounted partition to another using

`tar -C /mnt/source -cf - . | tar -C /mnt/target xvf -`

When I try this, I get 

```
tar: Must specify one of -c, -r, -t, -u, -x
: Write error
```

Can anyone suggest what this write error is due to?


----------



## SirDice (Apr 21, 2017)

Second tar(1) command is missing a dash for the options.
`tar -C /mnt/source -cf - . | tar -C /mnt/target -xvf -`


----------



## balanga (Apr 21, 2017)

I didn't think a dash was required for the options... There wasn't one in the example, so I just followed it. Anyway it works now, thanks.


----------



## SirDice (Apr 21, 2017)

gtar(1) doesn't require them, tar(1) does.


----------



## balanga (Apr 24, 2017)

Actually I just tried `tar zxf some.iso` (no dash) and it worked.


----------

