VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: resizing root partition  (Read 1829 times)

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
resizing root partition
« on: September 18, 2009, 07:52:57 pm »

I have come to the point where I need to resize my root partition. I made it only 4 GB when I installed when I really should have made it about 10GB. I would like some guidance as to how to go about doing this. Some information: I am using the ReiserFS filesystem, I want to take 6 GB from /home and give it to /. I know I need to back up my /home partition by tarring it and copying it to another hard drive in case some of /home gets wiped out or corrupted in the resizing process. Do I just simply compress it as a tar archive or do you have to compress it specially? (I thought I read something about having to do it a certain way). Should I use a Gparted live cd to resize the partitions?
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3234
Re: resizing root partition
« Reply #1 on: September 18, 2009, 08:36:36 pm »

Live cd is probably the easiest way to do this. No question about it. No need to jack with your files or anything. Just boot it and run gparted.

A vl light cd or even the Vectorlinux 6.0 install cd can do it. Both have gparted in them.

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: resizing root partition
« Reply #2 on: September 18, 2009, 11:16:18 pm »

as M0E suggests, a live cd with gparted is probably the best way.  I've actually just finished doing something very similar using Parted Magic (gparted as the utility) a few moments ago and everything worked out splendid. Shrunk an ntfs; moved and expanded a reiser; expanded a logical; moved a reiser within the logical; deleted and recreated a swap within the logical at a larger size. After all of that, I rebooted and came right back where I left off an hour ago - no problems. Of course, I did tar and backup my /home prior to any of the hard drive partition manipulations.  Hopefully yours goes as smoothly.
Logged

Daniel

  • Packager
  • Vectorian
  • ****
  • Posts: 704
    • TuxToys - Packages for VectorLinux 6.0
Re: resizing root partition
« Reply #3 on: September 19, 2009, 09:20:27 am »

Thanks for the replies! I have 2 things I would like to clarify. VL live cd's come with GParted? (since 6.0 I guess) Is it in the menu somewhere? Or do you have to start it from a terminal? Also, I don't have to tar /home a certain way? I can just right-click it and select compress as tar?

EDIT: Actually one more thing. Will /home get corrupted or lose data if I shrink it? (I will back up /home but I was just wondering...)
« Last Edit: September 19, 2009, 09:22:05 am by Daniel »
Logged
The following sentence is true. The previous sentence is false.

VL 6.0 SOHO KDE-Classic on 2.3 Ghz Dual-core AMD with 3 Gigs of RAM

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: resizing root partition
« Reply #4 on: September 19, 2009, 09:34:23 am »

Probably, yes. You can just right-click and select compress as tar. If it finishes without any errors then it should be good to go.

You will only be able to shrink /home as much as gparted will let you, which is generally no less than the amount of drive space actually being used. For instance, if you /home is 9gb and you're using 5gb then gparted should not let you shrink that partition any more than 4gb max.

Regarding backing up /home:
I actually followed Granny's advice from a different thread but just backedup my user directory rather than all of /home:
Quote
If you don't have a Linux-formatted external drive, you can tar your /home directory before copying it to any external media. You want to use
tar -cvpsPf
modifiers to preserve ownership and permissions. (Some say this isn't strictly necessary but I know it works, so I use it.) When you restore you want to use
tar -xpsPf
to make sure the files are restored with your ownership and permissions intact.

I ran:
tar -cvpsPf /home/<username>.tar /home/<username> --exclude=My_Network

This created a tar file in /home named newt.tar containing everything within /home/newt, however I had to also exclude a network mounted directory which is probably not the case for you.  After than, I gzipped it to make the transfer over wireless a bit quicker using this command:
gzip -c /home/<username>.tar > /home/<username>.tar.gz

« Last Edit: September 19, 2009, 09:35:55 am by newt »
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4108
Re: resizing root partition
« Reply #5 on: September 19, 2009, 11:50:53 am »

VL6.0 Light Live does have gparted available from the system menu.
Logged