# Move all data in a path to other path (different mount)

**URL:** https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554
**Category:** Elasticsearch
**Created:** [December 12, 2018, 1:54pm UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554 "2018-12-12T13:54:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![merceskoba](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@merceskoba](https://discuss.elastic.co/u/merceskoba)
#### Post date: [December 12, 2018, 1:54pm UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/1 "2018-12-12T13:54:05Z")

</div>

Hello guys,  
I have 250 gb ES in `/data/elasticsearch/` (/dev/sda1).  
The disk space is 60 gb left. I want to add new disk space using LVM (/dev/mapper/data-dataes)  
Do you guys have any idea to move all whole data into new path (new mount) ?  
I believe i need to change my `path.data` from `/data/elasticsearch` to be `/data_es/elasticsearch` but, how does elasticsearch reach old data in `/data/elasticsearch` ?

FYI, this is elasticsearch cluster. So, i have 3 instances.  
I am using Elasticsearch 5.6.3.

Is this documentation helping me ? [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-reroute.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cluster-reroute.html)

Thank you for your time and information

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [December 13, 2018, 2:38am UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/2 "2018-12-13T02:38:46Z")

</div>

If you have created a new LV to get more data, you may be missing a feature of LVM.

Look at this: [https://www.tecmint.com/lvm-storage-migration/](https://www.tecmint.com/lvm-storage-migration/)

You can use LVM mirroring to move the physical data. Basically you create a mirror on the new (larger) location, let it complete the mirroring, then delete the old mirror. Your data is moved and your application never knows (It may degrade performance)

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [December 13, 2018, 3:20am UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/3 "2018-12-13T03:20:48Z")

</div>

> [@merceskoba](#):
>
> I believe i need to change my `path.data` from `/data/elasticsearch` to be `/data_es/elasticsearch`

Yep.

> [@merceskoba](#):
>
> how does elasticsearch reach old data in `/data/elasticsearch` ?

It doesn't. You would need to `mv` the data in the old directory to the new one when Elasticsearch is not running.

Just make sure you take a backup, as this is not a supported process.

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [December 13, 2018, 3:47am UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/4 "2018-12-13T03:47:58Z")

</div>

If you need to use mv, look at the "rolling upgrade" procedures. Turn off shard routing, stop this node, do the mv, restart the node. If it worked, turn on shard routing. If you have all indexes set to replicate, you should have backiup copies on the other 2 nodes.

---

<div class="post-metadata">

### Author: ![merceskoba](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@merceskoba](https://discuss.elastic.co/u/merceskoba)
#### Post date: [December 14, 2018, 2:21am UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/5 "2018-12-14T02:21:39Z")

</div>

Thank you for your time...  
I have 3 instances...  
A-node, B-node, and C-node... all of these nodes are receiving LIVE data right now.  
Should i stop only one of them in the meantime ?  
This is the POC

1. `curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d' { "transient": { "cluster.routing.allocation.enable": "none" } } '`

2. `service elasticsearch stop`

3. change `path.data` to be `/data_es/elasticsearch`

4. `mv /data/elasticsearch /data_es/elasticsearch`

5. `curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d' { "transient": { "cluster.routing.allocation.enable": "all" } } '`

is there the way to upgrade disk space without Elasticsearch stopped ?  
Like, i deploy new instance and add it to existing instances configuration and then it will be resharding automatically.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 11, 2019, 2:21am UTC](https://discuss.elastic.co/t/move-all-data-in-a-path-to-other-path-different-mount/160554/6 "2019-01-11T02:21:40Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
