Sda1 partition shows twice its real size (after using rsync /* /mnt/sdb1)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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...
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...
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.