Skip to contentSkip to conversation

Mounting a new partition

DISCUSSION David Yeu 2 participants 2 messages Jul 17, 2002 – Jul 18, 2002

lore
Share & tools
lore

David Yeu

author
#0 lore raw

Just a quick question:

If I create a new partition and mount it over a point which contains data (lets say /var), will all the data be copied over to the new partition, or will everything be destroyed?

If the answer happens to be the latter, what's the workaround?

Thanks,
Dave Y.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 5 lines · David Yeu

Just a quick question:

If I create a new partition and mount it over a point which contains data (lets say /var), will all the data be copied over to the new partition, or will everything be destroyed?

No. That is, it will do neither of these things. The existing data will remains where they are, but they will be inaccessable, because the directory will now provide access to the mounted partition instead of its own contents.

Quoted 1 line

If the answer happens to be the latter, what's the workaround?

The "workaround" for what actually happens is to

(a) temporarily mount the new partition somewhese different (say
at /mnt)
(b) cp the files from the old directory to the new partition
(c) umount from the temporary location
(d) mount the new partition in its new location
(e) re-HUP or restart any processes that had files in the old, now
hidden directory, open (so they write to the corresponding files in the new partition).

Once you know that everything works, you can delete the files from the old (now inaccessable) directory, by doing this same sort of multi-step process. --
-----------------------------------------------"Never tell me the odds!"--------------
Ray Olszewski -- Han Solo
Palo Alto, California, USA [email protected]
-------------------------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs