NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Paladax
Feb 06, 2014Aspirant
Readynas 3200 disk space issue
Hi there, I have 2 of these units with both 12X 2tB disks in them. One unit it the primary unit that is where all my other site servers backup to. That then mirrors the data onto the 2nd offsite un...
fastfwd
Mar 06, 2014Virtuoso
Paladax wrote: Thanks, that explained the why a little better. Only now it is a bit more confusing because if i do that command from the root folder of my backups it tells me my backups are 22TB.. however the NAS itself it only 18TB.
Right. For example, imagine a parent directory containing four empty child directories:
NAS2:~/parent# du -h
4.0K ./child0
4.0K ./child3
4.0K ./child1
4.0K ./child2
20K .
Now we create a 100MB file in child0, and create hardlinks to that file in child1, child2, and child3:
NAS2:~/parent# dd if=/dev/zero of=./child0/file count=204000
204000+0 records in
204000+0 records out
104448000 bytes (104 MB) copied, 2.19748 s, 47.5 MB/s
NAS2:~/parent# ln ./child0/file ./child1/link1
NAS2:~/parent# ln ./child0/file ./child2/link2
NAS2:~/parent# ln ./child0/file ./child3/link3
To the "ls" program, each of the links looks like a 100MB file:
NAS2:~/parent# l -Rh
.:
total 16K
drwxr-xr-x 2 root root 4.0K Mar 6 13:06 child0
drwxr-xr-x 2 root root 4.0K Mar 6 13:07 child1
drwxr-xr-x 2 root root 4.0K Mar 6 13:07 child2
drwxr-xr-x 2 root root 4.0K Mar 6 13:07 child3
./child0:
total 100M
-rw-r--r-- 4 root root 100M Mar 6 13:06 file
./child1:
total 100M
-rw-r--r-- 4 root root 100M Mar 6 13:06 link1
./child2:
total 100M
-rw-r--r-- 4 root root 100M Mar 6 13:06 link2
./child3:
total 100M
-rw-r--r-- 4 root root 100M Mar 6 13:06 link3
But if we do a "du", we see the truth:
NAS2:~/parent# du -h
100M ./child0
4.0K ./child3
4.0K ./child1
4.0K ./child2
100M .
Unless we use the "-l" option to force du to treat links as though they're files:
NAS2:~/parent# du -hl
100M ./child0
100M ./child3
100M ./child1
100M ./child2
399M .
Paladax wrote: If that is right though it would explain why the other 18TB was filling up when I tried to mirror the data onto it while the source one was still showing only 42% full.
Yes. The program performing the copy was treating links as though they were the linked-to files. If you had used it on my example, it would have created four 100MB files on the destination drive rather than one 100MB file and three links.
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!