Mounted folders with bind take up space in root drive
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
A few months back, I have set up a separate storage for my data on my linux server (running Ubuntu 17.10).
The way I set it up is as follows:
/dev/mapper/community--vg-root
- primary drive - 60GB - mapped to/
/dev/xvdb1
- secondary drive - 100GB - mapped to/mnt/data
then, since I know I have many apps and data in: /opt
, /var
, /home
and /root
, I decided to use mount bind option, to move all the files to the new drive on /mnt/data
. My /etc/fstab
looks like this:
#<file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/community--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/community--vg-swap_1 none swap sw 0 0
# data - 100GB
/dev/xvdb1 /mnt/data ext4 defaults 0 1
/var /mnt/data/var none defaults,bind 0 0
/opt /mnt/data/opt none defaults,bind 0 0
/home /mnt/data/home none defaults,bind 0 0
/root /mnt/data/root none defaults,bind 0 0
The problem
Using df -h
I get:
/dev/mapper/community--vg-root 53G 16G 35G 32% /
/dev/xvdb1 98G 61M 93G 1% /mnt/data
But using du -h
in /mnt/data
I get:
14G .
So I definitely know that my binds and mounting is working, but all the data still takes up space in root.
All data has been moved from primary to the secondary drive, and then mounted. So there is no data in /var
, /opt
, /root
, /home
on the primary drive.
Once I even had to remove some files, because the system was unresponsive due to log files taking up all the space in root (which they can't, because they are on a different hard drive).
Is there any way to solve this problem? The reason why I added a second drive was to prevent the root drive from being full and moving my precious data to another drive which was only for data.
mount disk-usage bind
add a comment |Â
up vote
0
down vote
favorite
A few months back, I have set up a separate storage for my data on my linux server (running Ubuntu 17.10).
The way I set it up is as follows:
/dev/mapper/community--vg-root
- primary drive - 60GB - mapped to/
/dev/xvdb1
- secondary drive - 100GB - mapped to/mnt/data
then, since I know I have many apps and data in: /opt
, /var
, /home
and /root
, I decided to use mount bind option, to move all the files to the new drive on /mnt/data
. My /etc/fstab
looks like this:
#<file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/community--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/community--vg-swap_1 none swap sw 0 0
# data - 100GB
/dev/xvdb1 /mnt/data ext4 defaults 0 1
/var /mnt/data/var none defaults,bind 0 0
/opt /mnt/data/opt none defaults,bind 0 0
/home /mnt/data/home none defaults,bind 0 0
/root /mnt/data/root none defaults,bind 0 0
The problem
Using df -h
I get:
/dev/mapper/community--vg-root 53G 16G 35G 32% /
/dev/xvdb1 98G 61M 93G 1% /mnt/data
But using du -h
in /mnt/data
I get:
14G .
So I definitely know that my binds and mounting is working, but all the data still takes up space in root.
All data has been moved from primary to the secondary drive, and then mounted. So there is no data in /var
, /opt
, /root
, /home
on the primary drive.
Once I even had to remove some files, because the system was unresponsive due to log files taking up all the space in root (which they can't, because they are on a different hard drive).
Is there any way to solve this problem? The reason why I added a second drive was to prevent the root drive from being full and moving my precious data to another drive which was only for data.
mount disk-usage bind
2
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
Are you sure that you are binding in the right direction? You are mounting for example/opt
to/mnt/data/opt
. From the text of the question my impression was that you wanted to mount/mnt/data/opt
on/opt
.
â AlexP
Jul 19 at 8:43
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
A few months back, I have set up a separate storage for my data on my linux server (running Ubuntu 17.10).
The way I set it up is as follows:
/dev/mapper/community--vg-root
- primary drive - 60GB - mapped to/
/dev/xvdb1
- secondary drive - 100GB - mapped to/mnt/data
then, since I know I have many apps and data in: /opt
, /var
, /home
and /root
, I decided to use mount bind option, to move all the files to the new drive on /mnt/data
. My /etc/fstab
looks like this:
#<file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/community--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/community--vg-swap_1 none swap sw 0 0
# data - 100GB
/dev/xvdb1 /mnt/data ext4 defaults 0 1
/var /mnt/data/var none defaults,bind 0 0
/opt /mnt/data/opt none defaults,bind 0 0
/home /mnt/data/home none defaults,bind 0 0
/root /mnt/data/root none defaults,bind 0 0
The problem
Using df -h
I get:
/dev/mapper/community--vg-root 53G 16G 35G 32% /
/dev/xvdb1 98G 61M 93G 1% /mnt/data
But using du -h
in /mnt/data
I get:
14G .
So I definitely know that my binds and mounting is working, but all the data still takes up space in root.
All data has been moved from primary to the secondary drive, and then mounted. So there is no data in /var
, /opt
, /root
, /home
on the primary drive.
Once I even had to remove some files, because the system was unresponsive due to log files taking up all the space in root (which they can't, because they are on a different hard drive).
Is there any way to solve this problem? The reason why I added a second drive was to prevent the root drive from being full and moving my precious data to another drive which was only for data.
mount disk-usage bind
A few months back, I have set up a separate storage for my data on my linux server (running Ubuntu 17.10).
The way I set it up is as follows:
/dev/mapper/community--vg-root
- primary drive - 60GB - mapped to/
/dev/xvdb1
- secondary drive - 100GB - mapped to/mnt/data
then, since I know I have many apps and data in: /opt
, /var
, /home
and /root
, I decided to use mount bind option, to move all the files to the new drive on /mnt/data
. My /etc/fstab
looks like this:
#<file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/community--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/community--vg-swap_1 none swap sw 0 0
# data - 100GB
/dev/xvdb1 /mnt/data ext4 defaults 0 1
/var /mnt/data/var none defaults,bind 0 0
/opt /mnt/data/opt none defaults,bind 0 0
/home /mnt/data/home none defaults,bind 0 0
/root /mnt/data/root none defaults,bind 0 0
The problem
Using df -h
I get:
/dev/mapper/community--vg-root 53G 16G 35G 32% /
/dev/xvdb1 98G 61M 93G 1% /mnt/data
But using du -h
in /mnt/data
I get:
14G .
So I definitely know that my binds and mounting is working, but all the data still takes up space in root.
All data has been moved from primary to the secondary drive, and then mounted. So there is no data in /var
, /opt
, /root
, /home
on the primary drive.
Once I even had to remove some files, because the system was unresponsive due to log files taking up all the space in root (which they can't, because they are on a different hard drive).
Is there any way to solve this problem? The reason why I added a second drive was to prevent the root drive from being full and moving my precious data to another drive which was only for data.
mount disk-usage bind
edited Jul 19 at 6:52
asked Jul 19 at 5:14
Sonic656
12
12
2
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
Are you sure that you are binding in the right direction? You are mounting for example/opt
to/mnt/data/opt
. From the text of the question my impression was that you wanted to mount/mnt/data/opt
on/opt
.
â AlexP
Jul 19 at 8:43
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48
add a comment |Â
2
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
Are you sure that you are binding in the right direction? You are mounting for example/opt
to/mnt/data/opt
. From the text of the question my impression was that you wanted to mount/mnt/data/opt
on/opt
.
â AlexP
Jul 19 at 8:43
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48
2
2
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
Are you sure that you are binding in the right direction? You are mounting for example
/opt
to /mnt/data/opt
. From the text of the question my impression was that you wanted to mount /mnt/data/opt
on /opt
.â AlexP
Jul 19 at 8:43
Are you sure that you are binding in the right direction? You are mounting for example
/opt
to /mnt/data/opt
. From the text of the question my impression was that you wanted to mount /mnt/data/opt
on /opt
.â AlexP
Jul 19 at 8:43
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f457125%2fmounted-folders-with-bind-take-up-space-in-root-drive%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
2
If you mount dirs on top of directory structures with data, the data won´t disappear by itself.
â Rui F Ribeiro
Jul 19 at 5:18
@RuiFRibeiro I moved all the data to the actual new drive and mounted it to /mnt/data, after that, I mounted the folders with bind option
â Sonic656
Jul 19 at 6:39
Are you sure that you are binding in the right direction? You are mounting for example
/opt
to/mnt/data/opt
. From the text of the question my impression was that you wanted to mount/mnt/data/opt
on/opt
.â AlexP
Jul 19 at 8:43
@AlexP You're right, I think I messed it up. Thank you for your help!
â Sonic656
Jul 20 at 7:48