# How to properly use the --flat option?

**URL:** <https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645>\
**Category:** Support\
**Created:** [December 27, 2022, 1:31pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645 "2022-12-27T13:31:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kun](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kun](https://kopia.discourse.group/u/kun)\
**Post date:** [December 27, 2022, 1:31pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645/1 "2022-12-27T13:31:41Z")

</div>

Hi all,

When I use kopia with a s3 bucket as a backend, there is no sharding ([Sharding | Kopia](https://kopia.io/docs/advanced/sharding/)) while when using the filesystem backend there is.

I would like to disable sharding when using the filesystem backend.

I tried to use the --flat option, starting from a empty backup folder:

`kopia repository create filesystem --flat --path /backup_first`

What I get is this:

```auto
root@ubuntu:/backup_first# ls
_lo kopia.blobcfg.f kopia.repository.f q6b s2f xn0

```

I still get the folders for sharding and not a flat file only structure.

Do I misinterpret the --flat option?

Used kopia version: 0.12.1

Thanks a lot,  
Martin

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [December 30, 2022, 9:00pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645/2 "2022-12-30T21:00:50Z")

</div>

Besides the issue, that --flat doesn’t seem to work for you, what file system are you using? Sharding is rather vital for Kopia’s performance when performing searches and indexing. I don’t know of any regular file system, that will not perform terribly, when having to deal with thousands of files in a folder…

---

<div class="post-metadata">

**Author:** ![kun](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kun](https://kopia.discourse.group/u/kun)\
**Post date:** [January 3, 2023, 12:22pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645/3 "2023-01-03T12:22:31Z")

</div>

Happy new year!

I’m using a s3 bucket, so the repository is ‘flat’ anyway. But I do the kopia install and some things arround it with ansible. I’m testing the role with molecule and there the testing repository is located on the file system of a ubuntu container. I want to have this test as close as possible to the s3 setup and tried to use the --flat flag to get a ‘flat’ testing repository. It does not work.

I still don’t know what purpose the ‘–flat’ flag serves in the repository create context? What is it for?

Thanks a lot,  
Martin

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [January 3, 2023, 5:21pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645/4 "2023-01-03T17:21:43Z")

</div>

Happy new year to you as well!

I think the option --flat only applies to cloud based repos and that it’s deliberately disregarded on regular volumes. I dug a bit into the source code and found this explanation for it:

[https://github.com/kopia/kopia/blob/master/site/content/docs/Advanced/Sharding/\_index.md](https://github.com/kopia/kopia/blob/master/site/content/docs/Advanced/Sharding/_index.md)

---

<div class="post-metadata">

**Author:** ![kun](https://avatars.discourse-cdn.com/v4/letter/k/90ced4/32.png) [@kun](https://kopia.discourse.group/u/kun)\
**Post date:** [January 11, 2023, 1:13pm UTC](https://kopia.discourse.group/t/how-to-properly-use-the-flat-option/1645/5 "2023-01-11T13:13:32Z")

</div>

Ah I see. Thank you very much for your help!!
