LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-17-2003, 08:57 PM   #1
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Rep: Reputation: 30
Move space from one ext3 parition to another


In my slackware install, I have / as 5gigs, and /home as around 9 gigs, but i want to move some of the space back form /home to / since i dont have so much stuff in /home

Is there an eays way to move empty space from 1 partition to another, wihtout destroying any of the data?
I tried looking around in cfdisk, but it didn't seem like it could do that...

Thanks!
 
Old 12-17-2003, 09:40 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Probably not since when resizing ext3 you can't change the starting block of the partition. So if / and /home were back to back on the hard drive, shrinking /home would not change the starting block of /home which still resides directly after the end of /. Does that make sense?

Post the output of 'df -k' and 'cfdisk -Ps /dev/hda'. See if we can get creative moving stuff around.

The Linux LVM allows you to resize logical paritions at will. I've used it for a couple years now and it keeps you from running into problems like this. http://www.sistina.com/products_lvm.htm
 
Old 12-17-2003, 09:44 PM   #3
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
Yes...that first part made perfect sense.....

Here is df -k
Code:
robert@MOFETTE:~$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda4              4730632   3316280   1170164  74% /
/dev/hdb1               101089     16130     79740  17% /mnt/boot
/dev/hda5              9438216   1578188   7372860  18% /home
/dev/hdb2             19164900   5639256  12552108  31% /mnt/redhat
/dev/hda6               513028     83704    429324  17% /mnt/fatvital
/dev/hda7             53965120  32144800  21820320  60% /mnt/fatnonvital
As you can see, /home is well underused, and I would rather have more breathing room in /
Code:
root@MOFETTE:~# cfdisk -Ps /dev/hda
Partition Table for /dev/hda

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary           0    20466809     63    20466810 HPFS/NTFS (07)       Boot
 3 Primary    20466810    21832334      0     1365525 Linux swap (82)      None
 4 Primary    21832335    31599854      0     9767520 Linux (83)           None
 2 Primary    31599855   160071659      0   128471805 W95 Ext'd (LBA) (0F) None
 5 Logical    31599855    51086699     63    19486845 Linux (83)           None
 6 Logical    51086700    52114859     63     1028160 W95 FAT32 (0B)       None
 7 Logical    52114860   160071659     63   107956800 W95 FAT32 (0B)       None
Is this LVM program free?
 
Old 12-17-2003, 10:23 PM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Given you current setup. I'd probably convert /home into an LVM partition. On that new partition you can create a /home and another hog file systems from / on it. This would free up some space on /. And yes the LVM is free.[list=1][*]You can move the data off of /home with something like: tar -zcvf /home.tar.gz /home [*]Mark /dev/hda5 as a LVM partition in cfdisk.[*]Create a physical partition with: pvcreate /dev/hda5 [*]Then you create a volume group on that partition: vgcreate vg1 /dev/hda5[*]Next create a logical volume on the volume group: lvcreate -L1.6G -nhome vg1
Do this for each filesystem you want to mount on the LVM. Keep them as small as needed for now. You can enlarge them later.[*]Create a filesystem on each of the new logical volumes: mkreiserfs /dev/vg1/home
I like using reiserfs because I know it resizes well. You can also resize live file systems, although it may not be recommended to do so.[*]Mount the new filesystem on /home and update the entry in the /etc/fstab table:
/dev/vg1/home /home reiserfs defaults 1 1
[*]Extract the tar file back onto /home.[/list=1]

Make sure you understand everything above before you attempt it. Please ask questions if you have any. Also it may help to read the LVM howto on the sistina site.
 
  


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
ext3 lost space??? Fordor Linux - General 15 07-10-2005 12:09 PM
How to move space from one partition to another? Rgamboa Linux - Newbie 3 05-16-2003 04:39 PM
How to move space from one partition to another? Rgamboa Linux - Software 1 05-16-2003 04:02 PM
ext3 no free space even if there is m1-rail Linux - Software 2 04-20-2003 10:33 AM
When I try to move a file to a dir it says No Space Left on Device. Help KrazyKid Linux - Software 1 06-16-2002 09:06 PM

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

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