LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2012, 02:14 PM   #1
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Rep: Reputation: Disabled
How to add space to other partition?


hi there,
i want to install cpanel so i need more space in /,
I want to add more space from /home to /
am using centos 5.6

example:
now is like this

Filesystem Size Used Avail Use% Mounted on
/dev/md2 1016G 1.8G 963G 1% /
/dev/md1 496M 36M 435M 8% /boot
/dev/md3 1.7T 196M 1.6T 1% /home





i want to have like this



Filesystem Size Used Avail Use% Mounted on
/dev/md2 1.8G 2.8 T 1% /
/dev/md1 36M 435M 8% /boot
/dev/md3 196M 150G 1% /home


if is possible without lousing any data.

thanks.

Last edited by tejli007; 02-26-2012 at 02:16 PM.
 
Old 02-26-2012, 03:06 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by tejli007 View Post
I want to add more space from /home to /
I don't think you provided enough information for anyone to give you a detailed answer.

I haven't used Linux software RAID enough to know the answer even if you had given enough info. But I do know how to use google. The first hit when I tried google to get your answer looks pretty good:

http://www.howtoforge.com/how-to-res...-software-raid

The first step described there also looks like a very good step to get the additional data someone would need in order to give you a better answer. Post the output from
Code:
cat /proc/mdstat
Edit, now that I've read that whole link more carefully, I no longer think it is a good enough tutorial to get you through the whole process. But the first step of gathering relevant info is still a good idea while waiting for a better expert to help.

I also suggest posting the output from the following command as root:
Code:
fdisk -l

Last edited by johnsfine; 02-26-2012 at 03:16 PM.
 
Old 02-26-2012, 03:21 PM   #3
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
I don't think you provided enough information for anyone to give you a detailed answer.

I haven't used Linux software RAID enough to know the answer even if you had given enough info. But I do know how to use google. The first hit when I tried google to get your answer looks pretty good:

http://www.howtoforge.com/how-to-res...-software-raid

The first step described there also looks like a very good step to get the additional data someone would need in order to give you a better answer. Post the output from
Code:
cat /proc/mdstat
Edit, now that I've read that whole link more carefully, I no longer think it is a good enough tutorial to get you through the whole process. But the first step of gathering relevant info is still a good idea while waiting for a better expert to help.

I also suggest posting the output from the following command as root:
Code:
fdisk -l
here it is:

Code:
[root@server3 ~]# cat /proc/mdstat
Personalities : [raid1] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active raid1 sdb1[1] sda1[0]
      33553344 blocks [2/2] [UU]

md1 : active raid1 sdb2[1] sda2[0]
      524224 blocks [2/2] [UU]

md3 : active raid1 sdb5[1] sda5[0]
      1822445440 blocks [2/2] [UU]

md2 : active raid1 sdb3[1] sda3[0]
      1073741760 blocks [2/2] [UU]

unused devices: <none>
[root@server3 ~]#


fdisk -l :

Code:
[root@server3 ~]# fdisk -l

WARNING: The size of this disk is 3.0 TB (3000592982016 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
partition table format (GPT).


Disk /dev/sda: 3000.5 GB, 3000592982016 bytes
64 heads, 32 sectors/track, 2861588 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2       32768    33553408   fd  Linux raid autodetect
/dev/sda2           32769       33280      524288   fd  Linux raid autodetect
/dev/sda3           33281     1081856  1073741824   fd  Linux raid autodetect
/dev/sda4         1081857     2861588  1822445568   85  Linux extended
/dev/sda5         1081857     2861588  1822445567+  fd  Linux raid autodetect

WARNING: The size of this disk is 3.0 TB (3000592982016 bytes).
DOS partition table format can not be used on drives for volumes
larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID
partition table format (GPT).


Disk /dev/sdb: 3000.5 GB, 3000592982016 bytes
64 heads, 32 sectors/track, 2861588 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               2       32768    33553408   fd  Linux raid autodetect
/dev/sdb2           32769       33280      524288   fd  Linux raid autodetect
/dev/sdb3           33281     1081856  1073741824   fd  Linux raid autodetect
/dev/sdb4         1081857     2861588  1822445568   85  Linux extended
/dev/sdb5         1081857     2861588  1822445567+  fd  Linux raid autodetect

Disk /dev/md2: 1099.5 GB, 1099511562240 bytes
2 heads, 4 sectors/track, 268435440 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md3: 1866.1 GB, 1866184130560 bytes
2 heads, 4 sectors/track, 455611360 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md3 doesn't contain a valid partition table

Disk /dev/md1: 536 MB, 536805376 bytes
2 heads, 4 sectors/track, 131056 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md0: 34.3 GB, 34358624256 bytes
2 heads, 4 sectors/track, 8388336 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table

Last edited by tejli007; 02-26-2012 at 03:24 PM.
 
Old 02-26-2012, 03:32 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
That info shows me your goal is a little trickier to reach than I would have expected. But it certainly is doable.

I looked at a few online descriptions of the process and I don't understand why they make it as difficult and dangerous as they do. I think it should be a little simpler than the online descriptions make it. But maybe there is some aspect of software RAID I'm misunderstanding.

You should be aware of four layers for /home and three layers for / and that resizing must affect all layers. There might be some GUI tool that does all the layers together (as there is for non RAID partitions) making all this easy. I don't know it.

You have a file system for /home. That file system is inside a RAID partition md3. That RAID partition is inside logical partitions sda5 and sdb5. Those logical partitions are inside extended partitions sda4 and sdb4.

Lacking knowledge of a tool that coordinates the whole process, I think you would need to:
1) shrink the file system inside md3
2) shrink the RAID partition md3
3) shrink/move the logical partitions, I think leaving the freed space inside the extended partitions sda5 and sdb5.
4) shrink the extended partitions sda4 and sdb4 leaving the freed space before them

Then
5) Extend the primary partitions sda3 and sdb3.
6) Extend the RAID partition md2.
7) Extend the filesystem inside md2.

For step 5, online info I have read instead suggests:
5a) remove one of sda3 or sdb3 from md2
5b) grow the one that was removed
5c) replace and resync it
5d) remove the other
5e) grow it
5f) replace and resync it.
I don't know if/why all that is needed.

Last edited by johnsfine; 02-26-2012 at 03:41 PM.
 
Old 02-26-2012, 03:37 PM   #5
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
''You have a file system for /home. That file system is inside a RAID partition md3''

This means if i unsize this partition the raid 1 will not be active(will not mirrir)?
 
Old 02-26-2012, 03:43 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by tejli007 View Post
'This means if i unsize this partition the raid 1 will not be active(will not mirrir)?
I have no idea what you mean.
Hopefully some expert will soon look at posts 1 and 3 and give you a better answer.
 
Old 02-26-2012, 03:43 PM   #7
tejli007
LQ Newbie
 
Registered: Feb 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by johnsfine View Post
That info shows me your goal is a little trickier to reach than I would have expected. But it certainly is doable.

I looked at a few online descriptions of the process and I don't understand why they make it as difficult and dangerous as they do. I think it should be a little simpler than the online descriptions make it. But maybe there is some aspect of software RAID I'm misunderstanding.

You should be aware of four layers for /home and three layers for / and that resizing must affect all layers. There might be some GUI tool that does all the layers together (as there is for non RAID partitions) making all this easy. I don't know it.

You have a file system for /home. That file system is inside a RAID partition md3. That RAID partition is inside logical partitions sda5 and sdb5. Those logical partitions are inside extended partitions sda4 and sdb4.

Lacking knowledge of a tool that coordinates the whole process, I think you would need to:
1) shrink the file system inside md3
2) shrink the RAID partition md3
3) shrink/move the logical partitions, I think leaving the freed space inside the extended partitions sda5 and sdb5.
4) shrink the extended partitions sda4 and sdb4 leaving the freed space before them

Then
5) Extend the primary partitions sda3 and sdb3.
6) Extend the RAID partition md2.
7) Extend the filesystem inside md2.

For step 5, online info I have read instead suggests:
5a) remove one of sda3 or sdb3 from md2
5b) grow the one that was removed
5c) replace and resync it
5d) remove the other
5e) grow it
5f) replace and resync it.
I don't know if/why all that is needed.
wow linux is hard man.
Am ready to give you my server pass and to make it for me.
contact me at b.sejdini(at)yahoo.com if you can help me with this.
Thanks
 
Old 02-26-2012, 03:54 PM   #8
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by tejli007 View Post
wow linux is hard man.
I expect it isn't that hard. I just don't know the easier way.

BTW, have you ever resized a software RAID on Windows XP (I have). That is different but way harder, plus it required using Linux tools.

Quote:
Am ready to give you my server pass and to make it for me.
contact me at b.sejdini(at)yahoo.com if you can help me with this.
One item I didn't mention in this thread (I did in your other thread). Most of that work cannot be done while your server is booted normally. You need to shut it down and boot something such as a Linux bootable CD, then do all the partition resizing while that CD is booted. That makes it a bit trickier (I don't think impossible) for you do give control to someone remotely to do the commands for you.

My own skill level is high enough to blunder through something like this in person (I have done many similar tasks that way) but not nearly high enough to deal with the extra challenge of working remotely.

Since the system is so new, what is wrong with the plan of wipe it all out and install Centos (or Ubuntu if you really prefer) from scratch partitioned whatever way you want?

But looking at your other thread also made me realize you don't really need/want to mess with resizing md3. You really want to delete md3.
You can easily copy all of /home from md3 to some other directory on md2. Later you can dismount and eliminate /home and rename that other directory as /home. Then delete md3, sda5, sda4, sdb5 and sdb4. I think all that might even be doable while the full system is booted normally (as long as ordinary users aren't logged in).
Then growing md2 should be somewhat simpler with sda4 and sdb4 completely gone. Growing md2 would still require being booted from something else.

Last edited by johnsfine; 02-26-2012 at 04:18 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 01:57 PM
[SOLVED] Add unallocated space from one drive to an lvm2 partition of another drive thebombzen Linux - Hardware 2 01-07-2011 08:58 PM
can i resize root partition & add space to home? vinnie_vinodh Linux - Newbie 6 08-09-2010 06:35 AM
add space to / when from spare space on disk ctsiow Linux - General 4 11-07-2007 08:55 AM
Add disc to RAID5 and extend 1 partition to use that space. fellz Linux - Hardware 1 11-16-2006 07:34 PM


All times are GMT -5. The time now is 08:04 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration