LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Sda1 partition shows twice its real size (after using rsync /* /mnt/sdb1) (http://www.linuxquestions.org/questions/linux-general-1/sda1-partition-shows-twice-its-real-size-after-using-rsync-%2A-mnt-sdb1-627911/)

Frank64 03-13-2008 09:08 PM

Sda1 partition shows twice its real size (after using rsync /* /mnt/sdb1)
 
Hi there,

I was trying to build myself a script that would run through kron periodically and synchronize my internal drive sda partitions to my external drive sdb partitions. While performing the tests, rsyncing /* (sda1 partition) with some --exclude to /mnt/sdb1 was not very successful.

After a while I noticed my /dev/sda1 partition grew 3 times its 5.4Gigs. So I rm -rf /mnt/sdb1 and I saved 5.4G. But I am still left with another 5.4G I cannot find.

I tried looking for duplicate files and couldn't. I looked around with folders containing a copy of my sda1 partition and found nothing. I also looked in the Lost+found folder and it's empty. I rebooted, same 10.8G. I shut down my sdb external drive, rebooted and it still reports 10.8G.

Is it possible something's wrong in my filesystem and it reports twice the actual size it uses? Or do I really have 5.4G twice? If yes, how can I find it?

sda1 partition is ext3


EDIT: Ah, found something weird... when I use Kdiskfree (GUI) it shows my / partition as being mounted twice. When I use the applet kwikdisk it also shows the / partition as being mounted twice. One of them shows no size and the other shows 17G.

My first mount is through the disk ID, STetc..-PART1 and then I see /dev/sda1 as being mounted to / as well. My fstab does not show /dev/sda1, it shows only the ...-PART1.

All my other partitions are mounted using -PARTx in fstab.

Where does /dev/sda1 comes from?
tnx!

matthewg42 03-13-2008 10:03 PM

Try using the file size display mode in konqueror to see where your space is going.

bigrigdriver 03-13-2008 10:13 PM

Quote:

rsyncing /* (sda1 partition) with some --exclude to /mnt/sdb1 was not very successful.
I hope that /mnt/sdb1 was one of the --excludes. If, at any time, /mnt/sdb1 was not mounted when the script was run, you now have the contents of sda1 in folder /mnt/sdb1 (not partition sdb1). When /mnt/sdb1 (the partition) is mounted, it hides the contents, if any, of folder /mnt/sdb1. You can only see files written to that folder when sdb1 is unmounted.

Frank64 03-13-2008 10:18 PM

Quote:

Originally Posted by matthewg42 (Post 3088101)
Try using the file size display mode in konqueror to see where your space is going.

It's a little bit hard due to kcore file in /proc being 262TB. Terabytes, yes. But it shows 5.01G when I look overall in the computer, but when I go in /proc kcore becomes 262TB.

If I add up my folders under / using file size view it seems to be twice the size. But I can't tell what's wrong.

Oh crap, now I can't have the entire HDD view again, I can only see under a folder and under / it shows proc and kcore and nothing else. Hmmm...

Frank64 03-13-2008 10:23 PM

Quote:

Originally Posted by bigrigdriver (Post 3088112)
I hope that /mnt/sdb1 was one of the --excludes. If, at any time, /mnt/sdb1 was not mounted when the script was run, you now have the contents of sda1 in folder /mnt/sdb1 (not partition sdb1). When /mnt/sdb1 (the partition) is mounted, it hides the contents, if any, of folder /mnt/sdb1. You can only see files written to that folder when sdb1 is unmounted.

No, /mnt or /mnt/sdb1 was NOT part of the --exclude. I excluded a lot of stuff but I forgot all my /mnt/*. Damn it. :)

If I recall though, /mnt/sdb1 was mounted, cuz I copied into that folder. I also rm -rf it before unmounting it and this is where I gained 5.4G, but by then I was already 3 times my normal / size (5.4G). So it somehow grew one time before that last rsync.

/dev/sdb1 has always been mounted to /mnt/sdb1 so that I could copy /dev/sda1 (which is /) to /mnt/sdb1.

Now /dev/sdb is shut down (so unmounted) and /mnt/sdb1 does not exist, I have removed everything. So maybe there is still something hidden?

I can say that at the end I was seeing /mnt/sdb1/mnt/sdb1/* being rsynced. That is when I stopped the process. I see it in my rsync log file. Thing is, /mnt/sdb1 has been removed by sudo and I only gained half of what I should have.

For some reason, I thought / was being copied into sdb1, but my external drive never did anything, everything was copying into my internal sda drive, thought I did mount /dev/sdb1 to /mnt/sdb1. But I am positive, everything was being rsynced into the same HDD (source HD and target HD happened, somehow, to be the same).

I also don't understand why I have / being mounted in 2 ways (disk ID and device path), menu.lst, grub.conf and fstab are fine...

Frank64 03-14-2008 07:46 PM

Nope, nothing to do to fix this. I have tried different things and checked on other forums as well.

Could not know if sda1 was mounted twice or if I had files somewhere or if one or more files where twice its usual size.

So I reverted back to my 1-week old disk image and now it's all fine, everything is back as it should. God I love g4l, that software is awesome, you can screw your machine as much as you can and you simply rollback to previous image and it's like nothing happened. smile.gif I wanted to solve the problem without rolling back, it's very rare I cannot or I cannot find on an answer on the net, but this time was one of those.

g4l can be found at http://freshmeat.net/projects/g4l/?b...ease_id=272991

peetaur 11-04-2011 03:08 AM

The OP is very old, but this konqueror /proc/kcore problem still exists, and I can't find even another mention of it on the net, so I will reply anyway.

I have the same problem with Konqueror file size view... so I created a hack workaround.

Make a bind mount clone of your root file system excluding virtual directories which actually take no space (proc, dev, sys, srv), and mnt (or you will have double output). You should also exclude tmp if you have it mounted as a ramdisk/tmpfs, and other bind mounts in the root directory.

Run as root in the bash shell:

# mkdir /mnt/rootstuff
# cd /mnt/rootstuff/
# for f in `ls -1 /`; do mkdir $f; done
# rmdir dev proc srv sys mnt
# for f in `ls -1`; do mount -o rbind /$f $f; done

Then in konqueror, navigate to /mnt/rootstuff instead of / and go back to file size view.

To get rid of the hack, again in bash shell:

# cd /mnt/rootstuff
# umount -l *
# rmdir *
# cd ..
# rmdir rootstuff


All times are GMT -5. The time now is 08:42 PM.