查看完整版本 : mount folder同入面的file問題

SoMaster 2017-9-12 16:48

舉例, 有一個folder : /abc
入面有一個file : /abc/file.txt

現在我加入一個新硬碟, 做好分割 : /dev/sdc1

跟住就mount個新硬碟去依個folder
mount /dev/sdc1 /abc

咁abc入面本來既file, 係umount之前, 仲有冇任何方法可以access?

thinman 2017-9-12 17:40

[quote]原帖由 [i]SoMaster[/i] 於 2017-9-12 04:48 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=467708990&ptid=26921305][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
舉例, 有一個folder : /abc
入面有一個file : /abc/file.txt

現在我加入一個新硬碟, 做好分割 : /dev/sdc1

跟住就mount個新硬碟去依個folder
mount /dev/sdc1 /abc

咁abc入面本來既file, 係umount之前, 仲 ... [/quote]唔得.  點解你唔mount個device係empty folder ?  你咁做有可能 corrupt 你原本folder裡面嘅 files.

tam_n 2017-9-12 18:07

[quote]原帖由 [i]SoMaster[/i] 於 2017-9-12 04:48 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=467708990&ptid=26921305][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
舉例, 有一個folder : /abc
入面有一個file : /abc/file.txt

現在我加入一個新硬碟, 做好分割 : /dev/sdc1

跟住就mount個新硬碟去依個folder
mount /dev/sdc1 /abc

咁abc入面本來既file, 係umount之前, 仲 ... [/quote]我認為/abc已經mount(ed),再mount /dev/sdc1應該唔得,會有busy之類嘅信息。師兄可以做個簡單實驗試下,

SoMaster 2017-9-12 18:11

[quote]原帖由 [i]thinman[/i] 於 2017-9-12 05:40 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=467711215&ptid=26921305][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
唔得.  點解你唔mount個device係empty folder ?  你咁做有可能 corrupt 你原本folder裡面嘅 files. [/quote]


無, 之所以咁做, 只係因為新手學習中, 想試多D不同組合, 去理解d command做緊乜.

不過有一點唔明, 點解你話會 corrupt 原本folder裡面嘅 files? 因試過mount完之後, 加左好多新file落去. 當我umount之後, 原來的file出返黎, 亦無任何被修改的跡象, 好似無乜問題, 咁corrupt點先會出現?



另外仲有一個問題, 既然mount完之後, 原來的file係睇唔到, 咁點可以mount完, 舊file會搬左去新mount的空間?
其實而家情況係咁的, 由於原本裝linux的hard disk容量好細, 所以想將user同software的data轉去新加的硬碟

於是打算將/usr, /user, /var 搬過去新硬碟

本來係諗住改成咁的
/etc/fstab[code]UUID=0d9b29cd-d49b-47ae-a631-3bc373e1020c        /usr        ext4        defaults        0
UUID=0d9b29cd-d49b-47ae-a631-3bc373e1020c        /user        ext4        defaults        0
UUID=0d9b29cd-d49b-47ae-a631-3bc373e1020c        /var        ext4        defaults        0[/code]0d9b29cd-d49b-47ae-a631-3bc373e1020c 係sdc1的uuid

咁點先可以mount完, 但依三個folder依然會出現係新partition上?

[[i] 本帖最後由 SoMaster 於 2017-9-12 06:12 PM 編輯 [/i]]
頁: [1]
查看完整版本: mount folder同入面的file問題