0

I have about 3.6 'Terabyte' drive that is used for the root of the filesystem. When I look at the Disk Usage Analyzer, it shows that only about 1 'Terabyte' of that space is used. I have a 2 Terrabyte USB drive that is mounted to /media/disk. Whatever amount of data I store on this disk seems to be counted as used space on the root drive path. So the USB drive has 1.5 'Terabyte' of data used and the disk usage analyzer still only shows the 1 tb of space youed on the inteernal root drive, however a DF reveals that there is only less than a 'Terabyte' avalable on the root drive. Also, when I dismount the USB drive, I can still read and right the data to the /media/disk directory, so I am sure that Linux is keeping a temporary copy on the main file system.

Am I crazy or is this really how it works? Does it really store a copy of the data on the USB drive somewhere on the primary root drive? How can I change this or can you change it?

TrevJen
  • 264
  • 1
  • 6
  • 23

3 Answers3

4

Type 'mount' after you think the drive is mounted and see if the external drive is really mounted where you think. I'm betting it's either mounted somewhere else, or it's not mounted at all.

The fact that you can see the files under /media/disk means that you didn't have the drive mounted there when you put the files there.

Remember that mounting a filesystem on a particular path 'hides' that path. So, if you copied files to /media/disk, then mounted the USB drive on /media/disk, then looked at /media/disk, you'd see the files on the USB disk. But the files you copied beforehand are still on the main disk, and will become visible again after you unmount the USB drive.

Michael Kohne
  • 2,284
  • 1
  • 16
  • 29
  • Yes, I love Serverfault. You just saved me hours (ARRGGHH). I had noticed the data there when it was not mounted and I assumed that it was required there for ghosting or temporarily there since it was the exact same data that is copied there nightly (even when the drive is disconnected). – TrevJen Jul 28 '09 at 18:01
  • +1 For the information about how it hides the files. Never knew that... Although, I also never tried to mount on a non-empty mount point before :-) – Kyle Brandt Jul 28 '09 at 18:13
0

You must be either mounting the drive wrong, or copying the data to the wrong location. There is no local copy. The data was never put on the external drive.

You need to look at the files /etc/fstab and /etc/mtab with the drive plugged in to be able to find the real mount point of the external drive.

Joshua Nurczyk
  • 738
  • 6
  • 17
  • my mount command is mount /dev/sdc1 /media/disk here is my mtab /dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,gid=5,mode=620 0 0 /dev/sda1 /boot ext3 rw 0 0 tmpfs /dev/shm tmpfs rw 0 0 none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0 /dev/sdc1 /media/disk ext3 rw 0 0 [root@NB-BACKUP-01 disk]# – TrevJen Jul 28 '09 at 17:01
0

Verify the drive is mounted where and when you think it is. I find the output from the mount command hard to understand. The df -h command is much more user friendly.

  • If there is data in the /media/disk folder when the drive is unmounted then the data is on the root file system drive.

  • If it disappears when the USB drive is mounted then it is ONLY on the root drive.

  • If it stays when the USB drive is mounted (and the mount point is correct) then you have a copy on root and a copy on the USB drive. These copies may not be exactly the same.

You may want to mount the drive to a different folder (/mnt) and compare the data to what's in /media/disk. You may find that it was copied in the past or that you have been using the root disk unknowingly for some time. The rsync utility may be able to help you get the USB drive back into order in this case.

Chris Nava
  • 1,147
  • 1
  • 7
  • 9