increase /home partition

Hello all,

I need advice on how to increase the available space for /home

I’m runing OpenSUSE 12.2

I’ve added a new Volume Group (sdb) onto the machine and now the available space I want to add to the existing /home

How I can do that?

Device   |    Size|F|Enc|Type               |FS Type|Label|Mount Point    |   
/dev/sda | 1.64 TB| |   |LSI-RAID 5/6 SAS 6G|       |     |               |   
/dev/sda1| 2.01 GB| |   |Linux swap         |Swap   |     |swap           |   
/dev/sda2|20.00 GB| |   |Linux native       |Ext4   |     |/              |   
/dev/sda3| 1.61 TB| |   |Linux native       |Ext4   |     |/home          |   
/dev/sdb | 1.64 TB| |   |LSI-RAID 5/6 SAS 6G|       |     |               |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/dev/shm       |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/run           |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/sys/fs/cgroup |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/var/lock      |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/var/run       |   
tmpfs    |15.73 GB| |   |TMPFS              |TmpFS  |     |/media         |

Thanks

Hello and welcome here.

I see you already found out about the CODE tags. That is very fine indeed.

You posted some information about your partitioning, but we like to see the ouput of

su -c 'fdisk -l'

because that also shows begin and end (and thus the sequence) of the partitions.

For offering more space in /home to your users there are basicaly a few possibilities. One of them is to check if there is one of your users (may be there is but one user in the practical sense of the word, that makes it easier), if he needs extra space e.g. for his video files. Then you can create a new partition with a file system on it somewhere, and then mount it on that users ~/Video (thus /home//Video) or some other practical place with a name of his choice. You can also mount that partition at /mnt or /data and then let the user create a symlink from within his/her home directory, like

ln -s /data/usera-videos ~/Video

Many variations possible. Depends much on your needs.

But when you want the space not to be dedicated (except that it should be in /home), my advice would be to create a new file system on the new disk, mount it temporary in /mnt/temphome, copy all of /home to /mnt/temphome, umount /mnt/temphome and /home, change your /etc/fstab to let /home be mounted from the new disk, mount (new) /home. Ready and you then have the old /home as spare space. This must of course all be done from the real console with no normal user loged in (else /home is not free).

It is not possible to have two partitions mounted on /home at the same time. The only possibility to join those two partitions on both disks in one container, would be using somethingg like LVM. But I do not know if you want to go that far.

On 2013-09-04 12:36, adriancazan wrote:
> I’ve added a new Volume Group (sdb)

Are you using LVM?

Volume groups is LVM terminology, but your partition setup doesn’t show it.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

He seems to use disks from a RAID device. Inside that RAID device the exported containers might be known as Volume Groups. A bit strange indication, but that a as I interpreted his usage of the term.

But yes, a bit of explanation is always something we love. :wink:

Hello there,

The previous info was from yast-partitioner

below is the output of fdisk -l

MR:~ # fdisk -l

Disk /dev/sda: 1798.8 GB, 1798752436224 bytes
255 heads, 63 sectors/track, 218685 cylinders, total 3513188352 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000ff71

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sda2   *     4208640    46153727    20972544   83  Linux
/dev/sda3        46153728  3513188351  1733517312   83  Linux

Disk /dev/sdb: 1798.8 GB, 1798752436224 bytes
255 heads, 63 sectors/track, 218685 cylinders, total 3513188352 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

On the server I had 4 physical HDD’s grouped in a drive group0 (RAID5)
I upgraded the machine with 4 more drives and created the same drive group1 RAID5

This is seen by OS as 2 Virtual drives sda and sdb

What I want is a way of increasing /home withe the full disk capacity of sdb.

Thanks

No, it sees them as normal disks. The raid behind them is hidden to Linux. But that is not very important.

Well, my advice is above. You can not make one container for a file system out of two disk partitions on different disks, apart from using something like LVM.

Well LVM partitions are the only way to extend a partition across disks but you don’t have them. You can of course use mount to give some additions space for one or more mount points which can be used but that can be awkward. Soooo I’d say backup home repartition it as LVM remount it as home make a LVM on the second drive and join the two and copy the data back.

Note have you read about the problems of RAID 5 and multi terabyte drives? There have been several writeup as of late.

The RAID5 delusion | ZDNet

Why RAID 5 stops working in 2009 | ZDNet

On 2013-09-04 18:46, adriancazan wrote:

> On the server I had 4 physical HDD’s grouped in a drive group0 (RAID5)
> I upgraded the machine with 4 more drives and created the same drive
> group1 RAID5
>
> This is seen by OS as 2 Virtual drives sda and sdb
>
> What I want is a way of increasing /home withe the full disk capacity of
> sdb.

Let me see if I understand. Currently /home is sda3, and you want /home
to be the entire sdb?

That is not “increasing”.

Log all users out.
switch to runlevel 2 or 3.
log in as root (text mode).
Mount sdb somewhere.
copy /home to that somewhere
umount /home
Umount that somewhere
edit fstab so that sdb mounts as home
mount it.
check.
runlevel 5.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

The idea is to use sda3 + sdb for for /home

As an extra question, when defining the partition on sdb, this one should be primary or extended.

Thanks

On 2013-09-05 09:26, adriancazan wrote:

> The idea is to use sda3 + sdb for for /home

No, you need LVM or perhap RAID 0 for that. Normal partitions can not be
“added”.

Or you can add a directory for data, or put some users on one disk and
the rest on the other disk… whatever.

> As an extra question, when defining the partition on sdb, this one
> should be primary or extended.

Up to you. Without a use case, I can not tell (as the previous answer
was ‘NO’, I don’t know the current use case).

If you are going to use only one partition, you normally define it as
primary. Why bother to make an extended and then one logical inside?


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Thank you, now I know where to compromise :slight_smile:

You can also use mdadm. Both support non-persistent metadata which allows you to create VG/arrays even in the case when you cannot initialize device as PV/array member, but is probably a bit fragile as it depends on existence of configuration file (so it won’t work if booted from live media).

Actually using mdadm it is relatively easy to add existing partition as MD array member - just shrink file system a bit (256KB should be safe) and add partition using metadata format 0.9 or 1.0. Both write superblock at the end of device, which is now free after filesystem size has been reduced.

Please reread what we said and try to understand it. It is of no use that you say every time that you want to join sda3 and sdb1 (which you want to create on sdb)) and that we then repeat that it can’t be done. We run in circles.

Maybe you want to read a bit more about partitions, because you seem not realy to understand what primarty, extended and logical partitions are: SDB:Basics of partitions, filesystems, mount points - openSUSE

On 2013-09-05, adriancazan <adriancazan@no-mx.forums.opensuse.org> wrote:
> The idea is to use sda3 + sdb for for /home
>
> As an extra question, when defining the partition on sdb, this one
> should be primary or extended.

You seem not to understand the concept of partitions.

The terms sda' and sdb’ refer to different physical drives and so there’s no their respective partitions (i.e. sda1,
sda2 or sdb1, sdb2) can be combined for /home/ or any other directory. Of course within home, there’s no reason why you
can’t create symbolic links to these partitions e.g.


sh-4.2$ cd ~
sh-4.2$ ln -s /path/to/where/fstab/mounts/sda3 morehome
sh-4.2$

But if you’re trying to combine a partition from one drive (sda3) with a physically diffent drive altogether as a single
mount, then no-one can help you achieve the impossible.

On 09/05/2013 04:56 AM, hcvv wrote:
>
> adriancazan;2582927 Wrote:
>> The idea is to use sda3 + sdb for for /home
>>
>> As an extra question, when defining the partition on sdb, this one
>> should be primary or extended.
>>
>> Thanks
> Please reread what we said and try to understand it. It is of no use
> that you say every time that you want to join sda3 and sdb1 (which you
> want to create on sdb)) and that we then repeat that it can’t be done.
> We run in circles.
>
> Maybe you want to read a bit more about partitions, because you seem not
> realy to understand what primarty, extended and logical partitions are:
> ‘SDB:Basics of partitions, filesystems, mount points - openSUSE’
> (http://tinyurl.com/3rucjns)

Agreed. I think the best response here is the one from hcvv on 2013-09-04
10:56 UTC which made the combining of space possible using LVM, but it is
going to be a little bit of work… nothing terrible, but it’s the only
way so it is (as described) going to require creating a new LVM setup on
the new drive, mounting that somewhere, copying all data over, then
deleting the partition and making it an LVM volume and joining it to the
volume group that was created on the second drive. Now both drives are
usable in the same volume group (and thus the same volume).

Good luck.