How to safely move a directory to a different partition?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
My /
partition keeps filling up. To mitigate this, I'd like to move /opt
to a different directory, /usr/local/foo
, which is mounted to a different partition.
How do I do this safely? If I simply move /opt
to /usr/local/foo/opt
then create a link of some sort from /opt --> /usr/local/foo/opt
, will all the permissions, bits, etc. be correctly set up?
I'm using Ubuntu.
files filesystems
add a comment |Â
up vote
1
down vote
favorite
My /
partition keeps filling up. To mitigate this, I'd like to move /opt
to a different directory, /usr/local/foo
, which is mounted to a different partition.
How do I do this safely? If I simply move /opt
to /usr/local/foo/opt
then create a link of some sort from /opt --> /usr/local/foo/opt
, will all the permissions, bits, etc. be correctly set up?
I'm using Ubuntu.
files filesystems
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
My /
partition keeps filling up. To mitigate this, I'd like to move /opt
to a different directory, /usr/local/foo
, which is mounted to a different partition.
How do I do this safely? If I simply move /opt
to /usr/local/foo/opt
then create a link of some sort from /opt --> /usr/local/foo/opt
, will all the permissions, bits, etc. be correctly set up?
I'm using Ubuntu.
files filesystems
My /
partition keeps filling up. To mitigate this, I'd like to move /opt
to a different directory, /usr/local/foo
, which is mounted to a different partition.
How do I do this safely? If I simply move /opt
to /usr/local/foo/opt
then create a link of some sort from /opt --> /usr/local/foo/opt
, will all the permissions, bits, etc. be correctly set up?
I'm using Ubuntu.
files filesystems
files filesystems
edited Sep 6 at 17:31
asked Sep 5 at 21:58
Trent Bing
175111
175111
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05
add a comment |Â
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
rsync -a
followed by
mount --bind --make-slave
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
rsync -a
followed by
mount --bind --make-slave
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
add a comment |Â
up vote
0
down vote
rsync -a
followed by
mount --bind --make-slave
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
add a comment |Â
up vote
0
down vote
up vote
0
down vote
rsync -a
followed by
mount --bind --make-slave
rsync -a
followed by
mount --bind --make-slave
answered Sep 6 at 1:16
user1133275
2,297412
2,297412
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
add a comment |Â
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
Your answer is good for the most part, rsync and mount --bind are great here, but can you complement it to cover the OP's use case? What rsync command would be appropriate? How to empty /opt before mounting on top of it? How to get the bind mount to get mounted automatically on boot? (What syntax should be used in /etc/fstab for that?)
â Filipe Brandenburger
Sep 6 at 2:00
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467151%2fhow-to-safely-move-a-directory-to-a-different-partition%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Related: renaming a huge folder: is it risky?
â Kusalananda
Sep 6 at 19:05