Why does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?
Why does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?
I bought a 2 terabyte drive and mounted it in a subdirectory within my home directory.
Where /dev/sdb
is my 500GB system drive and /dev/sda
is my 2TB data drive:
Partition Mountpoint
/dev/sdb1 -> /
/dev/sdb3 -> /home
/dev/sdb2 -> swap
/dev/sda1 -> /home/data
This all seems to work, and even shows up in df -h
properly (i.e., /dev/sda1
is mounted on /home/data
[to regenerate the fstab I booted into my arch disk live environment and mounted the partitions to the folders in /mnt
that I wanted to partition, running genfstab -U /mnt > /mnt/etc/fstab
; it worked])
Last night I set my box to running a 650GB copy operation to /home/data
. Imagine my surprise when tons of copy operations failed due to being out of diskspace.
df -h
shows that /dev/sdb3
is full but /dev/sda1
is nearly empty (77MB). The mount point is functioning properly, so far as I can tell, but the copy operation put all the data in /dev/sdb3
! Presumably, if I unmount the drive, the music will still be in /home/data
.
Clearly there is something about mounting and fstab that I am not fully understanding.
The particular entry in fstab reads:
# /dev/sdb1
UUID=<UUID> / ext4 rw,relatime 01
# /dev/sdb3
UUID=<UUID> /home ext4 rw,relatime 02
# /dev/sda1
UUID=<UUID> /home/data ext4 rw,relatime 02
Before regenerating the fstab, I had a swap entry in fstab. I'm not sure why it didn't regenerate.
Update: I managed to get the output of mount
:
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4051032k,nr_inodes=1012758,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sdb1 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13569)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
/dev/sdb3 on /home type ext4 (rw,relatime)
/dev/sda1 on /home/data type ext4 (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=811560k,mode=700,uid=1000,gid=1000)
mount partition hard-disk fstab
|
show 3 more comments
Why does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?
I bought a 2 terabyte drive and mounted it in a subdirectory within my home directory.
Where /dev/sdb
is my 500GB system drive and /dev/sda
is my 2TB data drive:
Partition Mountpoint
/dev/sdb1 -> /
/dev/sdb3 -> /home
/dev/sdb2 -> swap
/dev/sda1 -> /home/data
This all seems to work, and even shows up in df -h
properly (i.e., /dev/sda1
is mounted on /home/data
[to regenerate the fstab I booted into my arch disk live environment and mounted the partitions to the folders in /mnt
that I wanted to partition, running genfstab -U /mnt > /mnt/etc/fstab
; it worked])
Last night I set my box to running a 650GB copy operation to /home/data
. Imagine my surprise when tons of copy operations failed due to being out of diskspace.
df -h
shows that /dev/sdb3
is full but /dev/sda1
is nearly empty (77MB). The mount point is functioning properly, so far as I can tell, but the copy operation put all the data in /dev/sdb3
! Presumably, if I unmount the drive, the music will still be in /home/data
.
Clearly there is something about mounting and fstab that I am not fully understanding.
The particular entry in fstab reads:
# /dev/sdb1
UUID=<UUID> / ext4 rw,relatime 01
# /dev/sdb3
UUID=<UUID> /home ext4 rw,relatime 02
# /dev/sda1
UUID=<UUID> /home/data ext4 rw,relatime 02
Before regenerating the fstab, I had a swap entry in fstab. I'm not sure why it didn't regenerate.
Update: I managed to get the output of mount
:
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4051032k,nr_inodes=1012758,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sdb1 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13569)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
/dev/sdb3 on /home type ext4 (rw,relatime)
/dev/sda1 on /home/data type ext4 (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=811560k,mode=700,uid=1000,gid=1000)
mount partition hard-disk fstab
1
Are you sure the quotedfstab
is correct? It also mountssdb3
under/home/data
although that is your/home
partition.
– Stefan Hamcke
Dec 31 '18 at 12:45
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
1
Please verify your mounts by adding the output ofmount
to your question.
– Hermann
Dec 31 '18 at 13:22
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18
|
show 3 more comments
Why does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?
I bought a 2 terabyte drive and mounted it in a subdirectory within my home directory.
Where /dev/sdb
is my 500GB system drive and /dev/sda
is my 2TB data drive:
Partition Mountpoint
/dev/sdb1 -> /
/dev/sdb3 -> /home
/dev/sdb2 -> swap
/dev/sda1 -> /home/data
This all seems to work, and even shows up in df -h
properly (i.e., /dev/sda1
is mounted on /home/data
[to regenerate the fstab I booted into my arch disk live environment and mounted the partitions to the folders in /mnt
that I wanted to partition, running genfstab -U /mnt > /mnt/etc/fstab
; it worked])
Last night I set my box to running a 650GB copy operation to /home/data
. Imagine my surprise when tons of copy operations failed due to being out of diskspace.
df -h
shows that /dev/sdb3
is full but /dev/sda1
is nearly empty (77MB). The mount point is functioning properly, so far as I can tell, but the copy operation put all the data in /dev/sdb3
! Presumably, if I unmount the drive, the music will still be in /home/data
.
Clearly there is something about mounting and fstab that I am not fully understanding.
The particular entry in fstab reads:
# /dev/sdb1
UUID=<UUID> / ext4 rw,relatime 01
# /dev/sdb3
UUID=<UUID> /home ext4 rw,relatime 02
# /dev/sda1
UUID=<UUID> /home/data ext4 rw,relatime 02
Before regenerating the fstab, I had a swap entry in fstab. I'm not sure why it didn't regenerate.
Update: I managed to get the output of mount
:
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4051032k,nr_inodes=1012758,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sdb1 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13569)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
/dev/sdb3 on /home type ext4 (rw,relatime)
/dev/sda1 on /home/data type ext4 (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=811560k,mode=700,uid=1000,gid=1000)
mount partition hard-disk fstab
Why does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?
I bought a 2 terabyte drive and mounted it in a subdirectory within my home directory.
Where /dev/sdb
is my 500GB system drive and /dev/sda
is my 2TB data drive:
Partition Mountpoint
/dev/sdb1 -> /
/dev/sdb3 -> /home
/dev/sdb2 -> swap
/dev/sda1 -> /home/data
This all seems to work, and even shows up in df -h
properly (i.e., /dev/sda1
is mounted on /home/data
[to regenerate the fstab I booted into my arch disk live environment and mounted the partitions to the folders in /mnt
that I wanted to partition, running genfstab -U /mnt > /mnt/etc/fstab
; it worked])
Last night I set my box to running a 650GB copy operation to /home/data
. Imagine my surprise when tons of copy operations failed due to being out of diskspace.
df -h
shows that /dev/sdb3
is full but /dev/sda1
is nearly empty (77MB). The mount point is functioning properly, so far as I can tell, but the copy operation put all the data in /dev/sdb3
! Presumably, if I unmount the drive, the music will still be in /home/data
.
Clearly there is something about mounting and fstab that I am not fully understanding.
The particular entry in fstab reads:
# /dev/sdb1
UUID=<UUID> / ext4 rw,relatime 01
# /dev/sdb3
UUID=<UUID> /home ext4 rw,relatime 02
# /dev/sda1
UUID=<UUID> /home/data ext4 rw,relatime 02
Before regenerating the fstab, I had a swap entry in fstab. I'm not sure why it didn't regenerate.
Update: I managed to get the output of mount
:
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=4051032k,nr_inodes=1012758,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sdb1 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13569)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
configfs on /sys/kernel/config type configfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
/dev/sdb3 on /home type ext4 (rw,relatime)
/dev/sda1 on /home/data type ext4 (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=811560k,mode=700,uid=1000,gid=1000)
mount partition hard-disk fstab
mount partition hard-disk fstab
edited Dec 31 '18 at 14:18
malan
asked Dec 31 '18 at 12:36
malanmalan
619421
619421
1
Are you sure the quotedfstab
is correct? It also mountssdb3
under/home/data
although that is your/home
partition.
– Stefan Hamcke
Dec 31 '18 at 12:45
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
1
Please verify your mounts by adding the output ofmount
to your question.
– Hermann
Dec 31 '18 at 13:22
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18
|
show 3 more comments
1
Are you sure the quotedfstab
is correct? It also mountssdb3
under/home/data
although that is your/home
partition.
– Stefan Hamcke
Dec 31 '18 at 12:45
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
1
Please verify your mounts by adding the output ofmount
to your question.
– Hermann
Dec 31 '18 at 13:22
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18
1
1
Are you sure the quoted
fstab
is correct? It also mounts sdb3
under /home/data
although that is your /home
partition.– Stefan Hamcke
Dec 31 '18 at 12:45
Are you sure the quoted
fstab
is correct? It also mounts sdb3
under /home/data
although that is your /home
partition.– Stefan Hamcke
Dec 31 '18 at 12:45
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
1
1
Please verify your mounts by adding the output of
mount
to your question.– Hermann
Dec 31 '18 at 13:22
Please verify your mounts by adding the output of
mount
to your question.– Hermann
Dec 31 '18 at 13:22
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18
|
show 3 more comments
1 Answer
1
active
oldest
votes
You mention that your copy command is cp -r /mnt/music data/
when you're in ~
.
This means that you're copying your data into /home/<username>/data
, since ~
would expand to /home/username
.
However, your external drive is mounted as /home/data
, according to the mount
output you supplied. To finish your goal, you need to do two things:
- copy all the data from
/home/<username/data
to the/home/data
directory.
rsync -avHP /home/<username>/data/* /home/data/
(or some variation)- this moves all the data out of your home partition and into the external drive.
- fix up how you want to access the drive
- leave it mounted as
/home/data
, and just access it that way - one option would be to create a symlink in
~
to access it:ln -s /home/data ~/data
- another option would be to edit your fstab to set the mountpoint for the external drive to
/home/<username>/data
- leave it mounted as
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491755%2fwhy-does-a-copy-operation-to-a-directory-that-serves-as-a-mountpoint-not-copy-th%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You mention that your copy command is cp -r /mnt/music data/
when you're in ~
.
This means that you're copying your data into /home/<username>/data
, since ~
would expand to /home/username
.
However, your external drive is mounted as /home/data
, according to the mount
output you supplied. To finish your goal, you need to do two things:
- copy all the data from
/home/<username/data
to the/home/data
directory.
rsync -avHP /home/<username>/data/* /home/data/
(or some variation)- this moves all the data out of your home partition and into the external drive.
- fix up how you want to access the drive
- leave it mounted as
/home/data
, and just access it that way - one option would be to create a symlink in
~
to access it:ln -s /home/data ~/data
- another option would be to edit your fstab to set the mountpoint for the external drive to
/home/<username>/data
- leave it mounted as
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
add a comment |
You mention that your copy command is cp -r /mnt/music data/
when you're in ~
.
This means that you're copying your data into /home/<username>/data
, since ~
would expand to /home/username
.
However, your external drive is mounted as /home/data
, according to the mount
output you supplied. To finish your goal, you need to do two things:
- copy all the data from
/home/<username/data
to the/home/data
directory.
rsync -avHP /home/<username>/data/* /home/data/
(or some variation)- this moves all the data out of your home partition and into the external drive.
- fix up how you want to access the drive
- leave it mounted as
/home/data
, and just access it that way - one option would be to create a symlink in
~
to access it:ln -s /home/data ~/data
- another option would be to edit your fstab to set the mountpoint for the external drive to
/home/<username>/data
- leave it mounted as
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
add a comment |
You mention that your copy command is cp -r /mnt/music data/
when you're in ~
.
This means that you're copying your data into /home/<username>/data
, since ~
would expand to /home/username
.
However, your external drive is mounted as /home/data
, according to the mount
output you supplied. To finish your goal, you need to do two things:
- copy all the data from
/home/<username/data
to the/home/data
directory.
rsync -avHP /home/<username>/data/* /home/data/
(or some variation)- this moves all the data out of your home partition and into the external drive.
- fix up how you want to access the drive
- leave it mounted as
/home/data
, and just access it that way - one option would be to create a symlink in
~
to access it:ln -s /home/data ~/data
- another option would be to edit your fstab to set the mountpoint for the external drive to
/home/<username>/data
- leave it mounted as
You mention that your copy command is cp -r /mnt/music data/
when you're in ~
.
This means that you're copying your data into /home/<username>/data
, since ~
would expand to /home/username
.
However, your external drive is mounted as /home/data
, according to the mount
output you supplied. To finish your goal, you need to do two things:
- copy all the data from
/home/<username/data
to the/home/data
directory.
rsync -avHP /home/<username>/data/* /home/data/
(or some variation)- this moves all the data out of your home partition and into the external drive.
- fix up how you want to access the drive
- leave it mounted as
/home/data
, and just access it that way - one option would be to create a symlink in
~
to access it:ln -s /home/data ~/data
- another option would be to edit your fstab to set the mountpoint for the external drive to
/home/<username>/data
- leave it mounted as
answered Dec 31 '18 at 17:12
Tim KennedyTim Kennedy
14.3k22950
14.3k22950
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
add a comment |
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
1
1
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
Holy cow Tim. Thank you so much. PEBCAK. I knew there was something horrifically stupid I was overlooking.
– malan
Dec 31 '18 at 17:44
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
We've all been there, @malan. That's why makes this site (and the other StackExchange sites) so valuable.
– Tim Kennedy
Dec 31 '18 at 19:12
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f491755%2fwhy-does-a-copy-operation-to-a-directory-that-serves-as-a-mountpoint-not-copy-th%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are you sure the quoted
fstab
is correct? It also mountssdb3
under/home/data
although that is your/home
partition.– Stefan Hamcke
Dec 31 '18 at 12:45
Whoops. I copied it from the screen rather than from the computer.
– malan
Dec 31 '18 at 13:06
Unfortunately, I'm at work now, so if this is something that requires a lot more information and isn't simply a known quirk, I'm going to have to wait to post more data.
– malan
Dec 31 '18 at 13:12
1
Please verify your mounts by adding the output of
mount
to your question.– Hermann
Dec 31 '18 at 13:22
@Hermann I managed to get it.
– malan
Dec 31 '18 at 14:18