LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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



Reply
 
Search this Thread
Old 03-13-2008, 10:08 PM   #1
Frank64
Member
 
Registered: Feb 2008
Distribution: Kubuntu 11.10 64-bits
Posts: 70

Rep: Reputation: 15
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!

Last edited by Frank64; 03-13-2008 at 11:01 PM.
 
Old 03-13-2008, 11:03 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Try using the file size display mode in konqueror to see where your space is going.
 
Old 03-13-2008, 11:13 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
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.
 
Old 03-13-2008, 11:18 PM   #4
Frank64
Member
 
Registered: Feb 2008
Distribution: Kubuntu 11.10 64-bits
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by matthewg42 View Post
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...
 
Old 03-13-2008, 11:23 PM   #5
Frank64
Member
 
Registered: Feb 2008
Distribution: Kubuntu 11.10 64-bits
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bigrigdriver View Post
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...

Last edited by Frank64; 03-13-2008 at 11:34 PM.
 
Old 03-14-2008, 08:46 PM   #6
Frank64
Member
 
Registered: Feb 2008
Distribution: Kubuntu 11.10 64-bits
Posts: 70

Original Poster
Rep: Reputation: 15
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
 
Old 11-04-2011, 04:08 AM   #7
peetaur
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
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

Last edited by peetaur; 11-04-2011 at 04:23 AM.
 
  


Reply

Tags
rsync, sda, size, twice


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/sda1 already mounted or /mnt busy. (SATA Sil 3112) psamuel01 Red Hat 14 10-10-2008 04:59 PM
USB Detection; when /dev/sda1 or /dev/sdb1 ravime Linux - Hardware 6 09-12-2007 07:15 AM
File manager shows inaccurate partition size. expat Linux - Laptop and Netbook 1 10-21-2006 11:20 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 01:55 PM
root partition shows wrong total size Dergro Linux - General 12 10-08-2003 01:49 PM


All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration