LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-08-2004, 01:40 PM   #1
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
df showing wrong output


I just upgraded my hard drive.

I fdisked the partitions, so they were the same as the existing drive, only bigger, created filesystems on them and then used dd to copy over the information.

I then swapped the drive cables, booted with a rescue disk, used lilo to put the MBR in place and rebooted.

All is well, a perfect upgrade, well almost.

When I run df the results are from the old drive, which is currently not mounted. Where does df get its information from, can this file be updated.

It's annoying to have df tell me that I have a 40gb drive when dmesg tell me the correct result of 160gb.

Please help.
 
Old 12-08-2004, 02:12 PM   #2
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
I m not sure if its possible but maybe you have recreated the partition when you used dd.
Does fdisk refer correct partition size now?
 
Old 12-08-2004, 02:14 PM   #3
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
The problem is using the dd command to transfer the files. dd will create an exact image of the original partition on the new larger partition but the result will be that linux will see the new partition just like the old partition, i.e dd created a block device on the new partition identical to the old and the extra space will not be detected. The dd created block device lives inside the new partition but cannot access the extra space. See this link for how to use the cp command to copy the files from one partition over to another preserving all permissions/links, etc:

http://lug.mtu.edu/lists/lug-l-0302/msg00051.html

that should give the result you want.

Last edited by kilgoretrout; 12-08-2004 at 02:20 PM.
 
Old 12-08-2004, 02:16 PM   #4
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
No df shows old information. My concern is that the system might think it if full, when it is really empty.
 
Old 12-08-2004, 02:19 PM   #5
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
What option did you give to dd command ? I would think it did fill the drive with 0's for remaining
empty space. To duplicate a partition into another partition with different size I would rather use
tool like tar.
 
Old 12-08-2004, 02:20 PM   #6
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Snip

The problem is using the dd command to transfer the files. dd will create an exact image of the original partition on the new larger partition but the result will be that linux will see the new partition just like the old partition, i.e dd created a block device on the new partition identical to the old and the extra space will not be detected. The dd created block device lives inside the new partition but cannot access the extra space.

Snip


So I am basically scr***d, with regard to the extra space.

Any suggestions about how to change the block size on the fly, or indeed any suggestions.
 
Old 12-08-2004, 02:22 PM   #7
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
snip

What option did you give to dd command ? I would think it did fill the drive with 0's for remaining
empty space. To duplicate a partition into another partition with different size I would rather use
tool like tar.

snip

dd if=/dev/hda1 of=/dev/hdc1 bs=1024

tar, hmm explain.
 
Old 12-08-2004, 02:26 PM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Your not screwed if you still have your old hd with the data on it. Even if you deleted it, you can copy what you have on your new drive back to the old, delete your partitions on your new drive, repartition and reformat then use the cp command like I indicated in my edited post to transfer the files to your new hard drive. All should be well then.
 
Old 12-08-2004, 02:29 PM   #9
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
I use tar like this to copy a mounted partition to another :
Code:
cd /mnt/source_partition
tar cf - . | (cd /mnt/destination_partition; tar xvf -)
I had problem with cp command, that's why I use tar
 
Old 12-08-2004, 02:38 PM   #10
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Original Poster
Rep: Reputation: 139Reputation: 139
Thanks kilgoretrout, cedrik

I have all the info, now on hdc, I will re-format and either cp or tar across.

thanks again

Samac
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Badram output from memtest86 seems wrong jshall755 Linux - Hardware 0 11-05-2005 03:50 PM
FC4 HDD showing wrong size h00ty Fedora - Installation 5 08-20-2005 11:10 AM
lspci showing wrong vga card xushi Slackware 4 03-27-2005 04:36 AM
why output is wrong ( C Program ) minil Programming 7 02-23-2005 06:05 AM
lspci -v showing wrong memory size for video card (NVIDIA Geforce4 Ti4200 8X) [NL]_Target Linux - Hardware 0 06-27-2004 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:39 PM.

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
Open Source Consulting | Domain Registration