Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Resize Hard Drive

    I want to resize my hard drive in gentoo. The problem is im not to sure if that im trying to do is possible. Right now my hardrive looks like this.

    dev/hdc1 /boot
    dev/hdc2 swap
    dev/hdc3 /
    dev/hdc4 /home

    The entire drive is partitioned and there is no free space. I want to resize my /home and give its space to /. Im not really sure how to go about this if it is possible. Can anyone help?

  2. #2
    Linux Guru antidrugue's Avatar
    Join Date
    Oct 2005
    Montreal, Canada
    Yes, you can do that. The simplest way would be to use a LiveCD, as the partitions cannot be mounted while you resize them.

    Try GParted Live CD :
    "To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."

    -Bruce Lee

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Monterey, California USA

    Re-Size / Re-Partition Hard Drive

    Yes. It is possible to resize or repartition your hard drive.

    Scenario A:

    * If you have adequate space on / to fit the contents of /home, then:
    * this scenario requires the use of gparted (download the bootable cdrom)
    1) Create a new directory under "/" called something like "/home1"
    # mkdir /home1
    2) cp (some would recommend tar or cpio) your files from /home to /home1
    # cp -prv /home/* /home1
    3) un-mount the home partition.
    # umount /home
    4) Change /etc/fstab to reflect the absence of the /home mount
    - no extra spaces or carriage returns in fstab.
    # vi /etc/fstab
    - find the line that has LABEL=/home and whack it.
    - cursor to that line and press the letter "d" twice.
    - press <esc>, then type :wq
    5) verify that all of your home directory information came across.
    6) destroy the old partition.
    # fdisk /dev/hdc
    > d
    > 4
    > w

    7) boot from the gparted live cdrom (it's only around 30MB total to download, accept the defaults at boot.)
    follow the prompts to move the swap, and enlarge/resize the / partition. (you can't move ext2 or ext3, but you can move your swap partition.)
    * all you need to do is enlarge your / partition to consume the space once occupied by /home

    Scenario B:
    Do the above, but you'll need to backup your /home directory to another location first.
    1) do the fstab stuff from step 4 above.
    2) backup your /home data

    on source computer:
    # tar czv /home | nc 9999
    on destination (where you want to backup your information) computer:
    # nc -l -p 9999 > home.tar.gz

    3) run the repartition, dropping /home, expanding /.
    4) restore your data:
    on the restore computer
    # cd /
    # nc -l -p 9999 | tar xvz

    on backup computer
    # nc 9999 < home.tar.gz
    <ip addresses are fictional>
    (yes, the destination computer can be Windoze, but you'll need netcat for windows to pull it off. another free download. )

    netcat: )



    Let me know if you need any help.

    None of these links contained viruses or malware upon my last inspection...
    blah, blah...and there is no warranty. These instructions will probably cause irreparable damage to your data, possibly warping the physical disk, causing it to explode into mutliple flying platters of death. It could also be responsible for global warming, floods, and/or another ice age. Use at your own risk.

  4. $spacer_open
  5. #4
    THANK YOU!!!! That was exactly what I needed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts