Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cloned Gentoo Partitions df reports wrong partition size?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
hal8000b
n00b
n00b


Joined: 28 Sep 2004
Posts: 32
Location: UK

PostPosted: Mon May 16, 2005 5:12 pm    Post subject: Cloned Gentoo Partitions df reports wrong partition size? Reply with quote

I was running a little low on disk space on / so I used dd to clone partitions 19 and 20
and move them to 21 and 22. My new / partition, hda21 is 5G.

I have a multi boot linux system so
dd if=/dev/hda19 of=/dev/hda21
dd if=/dev/hda20 of=/dev/hda22

I edited fstab on the new / to load corect partitions but df reports the / partition as 4.1G?

bash-2.05b$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda21 4.1G 3.3G 814M 81% /
/dev/hda22 2.1G 122M 1.9G 6% /home


Output of cfdisk:

Disk Drive: /dev/hda
Size: 163928604672 bytes, 163.9 GB
Heads: 255 Sectors per Track: 63 Cylinders: 19929

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
--snip--
hda19 Logical Linux ReiserFS 4301.83
hda20 Logical Linux ReiserFS 2155.03
hda21 Logical Linux ReiserFS 5362.89
hda22 Logical Linux ReiserFS 2155.03


The output of cfdisk reports partition 21 as 5.3G so why does the df command pick up the old partition 19 size?

sfdisk also reports more blocks than the old partition 19

bash-2.05b# sfdisk -s /dev/hda19 /dev/hda21
4200966
5237158

Thank you in advance ladies and gentlemen.
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Mon May 16, 2005 6:00 pm    Post subject: Reply with quote

hal8000b,

Most of your problems, I believe, are related to trying this with logical partitions. Each logical partition contains its own "partition table" if you will, that basically links one logical partition to the next, and if I am not mistaken also contains how many blocks the logical partition has. When you use the dd command, you are copying that information along with the data.

Why do you not just use cp -a, tar, or even rsync to copy the contents of each partition to its new home? Also, you might take a look at partimage.
_________________
Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Mon May 16, 2005 6:12 pm    Post subject: Reply with quote

hal8000b,

You copied your partitions block by block, including the filesystem structure. That strucure includes a description of a the free and used space. Providing your root partition is not involved, use
Code:
cp -a /source/mount/point /destination/mount/point
Make a temporary mount point if you need to.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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