# 把nextcloud的資料映射到raid

**結合docker的nextcloud**

**進入docker的nextcloud的console中，可以得知所有的資料與設定，都存放在/var/www/html中，而個人上傳資料，則位於data目錄下，以admin而言，就是**

**/var/www/html/data/admin/files/**<br>

**所以，基本上，我們只要把資料映射到我們的raid1磁碟目錄，便能永久保存與簡易維護資料**<br>

**刪除之前的nextcloud-temp容器，然後建立一個可以將資料轉存到raid1磁區的儲存雲吧**<br>

**設定與之前相同，多了個 volumes 的設定**

![](https://lh6.googleusercontent.com/i15WemdSr3ZYya1M-rRo_ghUzAShQzAf-tNU7xosNJcxBNKg-CrMOghpZQfZ9sXJXMVKnj7hh17oxzcujtGZzRR3Uj48miZVyxnzT4K0-JqOiQRGaCMzqvyZiKzek3Ux4330Fysk)

**上些檔案吧，然後你應該可以在/mnt/raid1/nextcloud/data/admin/files/找到上傳的檔案，此時資料都位於raid1磁區中，安全性提高許多**

**移除容器，在從新產生容器，你可以發現相關設定都保留下來了**<br>

**開機自動啟動nextcloud容器**

![](https://lh6.googleusercontent.com/aHAh8hfu7dK3fzmaRUJF5qVzrco5MRVl4XZx5ycpjZvJR4C2KHnI1fqeex_wm1gF95QivQX5pg96kLpZbZpb1peoSV28oxPm-KWhtv5jra6O5dNsM803NMKD2YsyMjcskDReOEd2)

**完成以上的動作，你可以嘗試重新啟動ubuntu系統，看看所需都服務是否正確無誤的執行，資料是否仍在**<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/docker-cong-an-zhuang-dao-ying-yong-ru-men-pian/ba-nextcloud-de-zi-liao-ying-she-dao-raid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
