Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
df and fdisk don't agree [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Fri Apr 16, 2004 11:14 pm    Post subject: df and fdisk don't agree [Solved] Reply with quote

I copied (using Norton Ghost) over my Gentoo installation from a 30GB drive to a 120GB drive. Before I had 3 partitions and now I have 4. / and home are going to have their own partitions now. I made both / and home 58GB each. I copied / from the old drive to / of the new drive. When I boot into the new drive it says that / (/dev/hda3) is only 30GB, which is the size of the parition I copied from. It looks like Nortin Ghost changed the size of the parition on my new drive from 58GB to 30GB but fdisk still says it is 58GB. Is there anything I can do to get the system to see that it is really a 58GB parition?

Thx

Update
Well I figured my system was messed up anyway and I was going to need to find another way to move my install to a bigger hd so I took drastic measures. I booted into the live cd, ran parted and resized the partition. I simply resized it to the exact same size. When I booted back to my new hd, reiserfs -fix something or other ran for a while then the system booted. The filesystem and the partition now agree that the parition is 58GB.
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Sat Apr 17, 2004 1:22 am    Post subject: Reply with quote

Quick explanation: df reports filesystem size, and fdisk reports partition size. In the usual case they're the same, but when you do something like copy a partition image into a different partition they can disagree. Like you saw.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sat Apr 17, 2004 1:31 am    Post subject: Reply with quote

Yep. That is what I found out and it makes sense to me now. Ghost was not good choice for what I was trying to do. IE Move a smaller parition to a larger partition. For future reference, what should I have used?

Thx
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Sat Apr 17, 2004 2:45 am    Post subject: Reply with quote

HomerSimpson wrote:
IE Move a smaller parition to a larger partition. For future reference, what should I have used?


I usually use a pair of tar's, a pipe, and the -C option myself, but "cp -ax" (a=archive, includes preserving permissions and times, doing the Right Thing for symlinks and other special files, and recursion; and x=one file system so it doesn't go off copying the destination into itself recursively) is probably a lot easier.

I believe there's a moving to a new hard disk mini-HOWTO on TLDP as well.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sat Apr 17, 2004 1:55 pm    Post subject: Reply with quote

I moved my / partition using ghost. On my new and bigger hd I made a new partition that I am now mounting as /home. I booted the live cd and used cp- R -p and did that directory. In the future I will look at doing what you posted (note I am still a noob at Unix/Linux). Is cp -R -p OK for copying over home directories? Should I re-copy my home directories with cp -ax?

Thx
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
Astaroth33
n00b
n00b


Joined: 19 Oct 2003
Posts: 36

PostPosted: Sat Apr 17, 2004 8:12 pm    Post subject: Reply with quote

I used the dd command line utility to copy to an unformatted drive, and then I used the commercial program Partition Commander to resize the partitions. Worked out fine.
Back to top
View user's profile Send private message
sapphirecat
Guru
Guru


Joined: 15 Jan 2003
Posts: 376

PostPosted: Sat Apr 17, 2004 8:32 pm    Post subject: Reply with quote

HomerSimpson wrote:
Is cp -R -p OK for copying over home directories? Should I re-copy my home directories with cp -ax?


Well, the -a is equivalent (in the man page for fileutils-4.1 I'm reading) to -dpPR, which means you missed out on:
-d: copy symlinks as links
-P: copy symlinks as links, including ones given in the parameter list. [POSIX 2003]

So you have extra copies now of anything you had symlinked. You probably didn't have anything mounted anywhere under /home, so -x probably made no difference.

And the advice: if you're worried, or you know you had many symlinks, go ahead and copy it again. You can even get only the symlinks with:
Code:
cd /old-home
for i in `find . -type l` ; do cp -af "$i" "/new-home/$i" ; done

Fix the /old-home and /new-home paths, of course.
_________________
Former Gentoo user; switched to Kubuntu 7.04 when I got sick of waiting on gcc. Chance of thread necro if you reply now approaching 100%...
Back to top
View user's profile Send private message
HomerSimpson
l33t
l33t


Joined: 25 Jan 2003
Posts: 869
Location: Ohio, USA

PostPosted: Sun Apr 18, 2004 12:57 am    Post subject: Reply with quote

I didn't create any symlinks but I don't know what the various apps that I have installed may have put in my ~ directories. As long as I have everything I am OK. If I have too much because I have the actual files and not just the link then I am not too worried either as I am only using 6% of my new home partition.

I really appreciate all the info you have all given me. I wish I had asked first and copied second. ;)
_________________
The strong must protect the Sweet.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum