LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-22-2002, 09:49 PM   #1
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
Question Resizing little problem


I moved my Linux system from a 20gig HD to a 60gig (cp /dev/hda* /dev/hdb* to existing bigger partition then I switched HD) but some progs (like df) still see my old HD size... but some (like fdisk or parted) see the real size (or at least the real starting-ending cylinder).
Is that because the system haven't perform a check yet?
Or because the ext3 journal contains information about the old hd?

Sorry, I think the question is very lame but I feel tired of searching in man/how for tonight... and I don't want to do something stupid.
 
Old 08-24-2002, 03:25 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Maybe using df --sync option would return the correct size??? If you do get this figured out, or if it "auto" fixes itself, please let me/us know, I will probably be doing this soon.

Thanks
 
Old 08-24-2002, 03:36 AM   #3
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
df works on file systems, not on partitions. You filesystem is the same size, your partition size has changed.

Regards
 
Old 08-24-2002, 11:24 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I think what you actually wanted to do here is plug in the new drive and create partitions and filesystems on it, then put the data on the old partition on it.

maybe use tar to copy it over




Last edited by DavidPhillips; 08-24-2002 at 11:26 PM.
 
Old 08-24-2002, 11:34 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
mkdir /tmphd
mount /dev/hd?? /tmphd

cd /

or the folder to copy

then
--------------------------------------------------
"suggested by mlp68"

tar c . | tar --same-owner -xpC /tmphd

--------------------------------------------------

or maybe

cp -dbR

or

cp -a


Last edited by DavidPhillips; 08-24-2002 at 11:45 PM.
 
Old 08-25-2002, 02:59 PM   #6
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Original Poster
Rep: Reputation: 46
Herm ok... Is There a way to change the size of my file system (the device) without creating a new system? I tried cp -R / /(the new hd mounted somewhere) but linux can't do this, I have some bug copying the directory /proc and because the new hd is mounted, when I copy / it create an infinite loop until the hd is full... I don't really want to start a fresh install on the new hd, then move the data.

I dunno, there are no easy command to force linux to increase the size of a device?
 
Old 08-25-2002, 08:36 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
trying to think of how I did it once a little while back

I booted from a root floppy, mounted both drives and did it that way
 
Old 08-25-2002, 09:16 PM   #8
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
or just copy all folders in / except /proc



then just create a /proc folder on the new partition

Last edited by DavidPhillips; 08-25-2002 at 09:20 PM.
 
Old 08-25-2002, 09:19 PM   #9
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
if you use cp -R it will follow the links, are you sure that's what you want?
 
Old 08-25-2002, 09:24 PM   #10
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I resize mine all the time when working on my image that I am building, to make it smaller.


I just create a filesystem and fill it with zero's then mount the two images on a loop device and cp -dbR the files from the old one to the new one.



I can't remember ever making a filesystem on a partition with data before, not sure what will happen.
 
Old 08-28-2002, 11:08 PM   #11
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Original Poster
Rep: Reputation: 46
FINALLY!!!!
I have sucessfully resized my partition, it's a REAAAAL pain, I never tought it was to be so hard. Anyways... I created my new partition then I reinstall a new Slackware 8.0 system... I made this system operational then I copy all my old data in... the REAL problem was to copy data without corrupting the system (I killed Slack 4 time in trying), for example, in copying a new library over a "old" (giving by the installation) one. Anyways now it's working near good as it was before except few bugs.

Example:
-Kde losts all my custom font... I suppose this was not saved in the home directory.

-All Gtk Progs have a white background instead of a gray... I really dunno why... I will try updating my gtk library, I suppose all progs take the ones that come with Slack by default.

-All my users was lost so I will have to recreate them all. It's annoying but I just have a dozen of users (most of them are ftp users) so it's not a real problem 'til I have their home directory.

-Kde bugs often... I suppose I still have few old Kde 2.2.1 and QT libs somewhere... I will have to check about this... Did someone know exactly what happen to kde 2.2.1 files when I update to 2.2.2 ? Are these files replaced?

Hum, in conclusion, resizing a *nix partition is a real painful experience.
MasterC, if you don't REALLY need resizing, please don't try it!!!
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing Partitions Problem! mayhemart Linux - General 1 09-24-2005 05:10 PM
Problem in booting after resizing partition rahulgup Linux - General 1 03-05-2005 10:06 AM
Resizing partition problem GEEF Linux - General 2 11-18-2004 07:59 PM
partition/resizing problem wslyhbb Linux - General 1 03-13-2004 10:32 PM
Problem with resizing NTFS.. Imek Linux - General 1 01-04-2004 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:55 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