LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Copying hda3(~5GB) to hda1(~10GB) nearly fills hda1 (https://www.linuxquestions.org/questions/linux-software-2/copying-hda3-%7E5gb-to-hda1-%7E10gb-nearly-fills-hda1-420684/)

APB_4 03-01-2006 01:17 PM

Copying hda3(~5GB) to hda1(~10GB) nearly fills hda1
 
I recently ran out of space on my root partition but I've liberated a couple of x windows partitions. Now what I want to do is copy everything on the current root hda3 to hda1, I've tried using dd and cp but both have resulted in leaving approximately the same amount of free space left on hda1 as on hda3. Eg. Before: hda3 used space=4.75GB; hda1 used space = 0
After: hda1 used space = 9.98GB, free space = 17.42MB; hda3 free space=17.42MB
Anybody got any ideas why this happens and what I can do to stop it?

gilead 03-01-2006 01:32 PM

Are the source and destination filesystems both native linux filesystems (ext2/3, reiserfs, etc.)? If so, can you post the cp command that you used? If /dev/hda3 was mounted on /mnt/src and /dev/hda1 was mounted on /mnt/dest you should just need something like:
Code:

cp -a /mnt/src/* /mnt/dest

APB_4 03-01-2006 04:59 PM

Thanks for the reply gilead. They are both reiserfs. The cp command was
Code:

cp /dev/hda3 /dev/hda1
Also if you're interested the dd commands were similar although I tried several they were along the lines of
Code:

dd if=/dev/hda3 of=/dev/hda1 bs=4096
When I tried a copy from mounted filesystem to mounted filesystem I got a load of crap about things in /sys and /proc which is why I changed to using /dev/hda(n)

michaelk 03-01-2006 06:12 PM

Quote:

dd if=/dev/hda3 of=/dev/hda1 bs=4096
This just basically copied byte for byte hda3 into hda1. So hda1 is an identical filesystem of hda3 which is why you still have the same amount of free space. Using the cp command for filesystems that are not the same size will work better but you will need to reformat hda3.

But why not use both hda1 and hda3. Is your entire install one partition or several? If you need more space in /usr or /var or /home for example just copy the that directory into the new partition and create an entry in fstab to mount it as such.

BTW.
http://wiki.linuxquestions.org/wiki/Dd


All times are GMT -5. The time now is 04:10 PM.