upgrade capacity /home with new harddrive

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dimasyudi

upgrade capacity /home with new harddrive

Post by dimasyudi »

Hi all i just learning linux mint,i installed linux mint 17 qiana with 3 partition. 60 GB ext4 for /,2GB for swap,and around 400GB ext4 for /home.
after use for several weeks,i realize that i need more capacity for /home because this comp used for fileserver. i have a plan to add new harddrive around 1TB to upgrade capacity of /home,but i dont know how to merge new harddrive to /home partition. i have read some article that use LVM partition to merge 2 harddrive to 1 partition,but im still confusing to understanding and how to do that. do i need to reformat /home partition to lvm filetype?

many thank for any replying and sorry for my bad english,i hope all of you understand what i mean :D
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: upgrade capacity /home with new harddrive

Post by WharfRat »

dimasyudi,

In order to create a logical volume for /home, you would first have to mark the disk partitions you intend to use as physical volume members. That will create a header on each partition. Then create a volume group adding all the physical volume to it . Finally you create the logical volume(s) and format it/them.

So in your case you will have to backup your /home and restore it to the logical volume and modify fstab to mount the lvm before booting.

What you can do as an alternative is create a mountpoint for the new disk and mount it for additional storage. You can move the files that you want the fileserver to have access to to the new disk.

Also you might want to consider shrinking your / partition, as 60gig is quite large, and extend your /home if you're experiencing constraints.

Good luck :wink:
Ginsu543

Re: upgrade capacity /home with new harddrive

Post by Ginsu543 »

First of all, if you're using your computer as a file server, then you most likely do not need 60GB for your / partition (since I'm assuming you're not installing a lot of programs). You could use Gparted to shrink that partition down to probably 20 or 25GB and be just fine (of course, expand your /home partition by the difference).

Also, depending on how you're serving up your files, you can simply add your new 1TB drive, format it in ext4, and add it as a /data partition (in other words, you don't have to merge it into your /home). That will allow you to access files on your 1TB drive.

Or, if like me you want cross-platform accessibility to your data, you can format the 1TB drive in NTFS. While NTFS is less robust as a file system than ext4 is, it allows me access to my data whether I'm in Linux, Mac OS X, or Windows (I dual-boot Linux and OS X, and I run Windows as a VM in VirtualBox). So I'm sacrificing a little bit of security for versatility, but it's worth it because I have all my data backed up on redundant drives.
dimasyudi

Re: upgrade capacity /home with new harddrive

Post by dimasyudi »

WharfRat wrote:dimasyudi,

Also you might want to consider shrinking your / partition, as 60gig is quite large, and extend your /home if you're experiencing constraints.

Good luck :wink:
Ginsu543 wrote:First of all, if you're using your computer as a file server, then you most likely do not need 60GB for your / partition (since I'm assuming you're not installing a lot of programs). You could use Gparted to shrink that partition down to probably 20 or 25GB and be just fine (of course, expand your /home partition by the difference).


ah i see,,so for fileserver i just need around 20gig for root partition. i set 60gig because i read some article that recommend to give extra size of root partition. i'll try to reduce that for some extra capacity in /home/
Ginsu543 wrote:
Also, depending on how you're serving up your files, you can simply add your new 1TB drive, format it in ext4, and add it as a /data partition (in other words, you don't have to merge it into your /home). That will allow you to access files on your 1TB drive.
WharfRat wrote:dimasyudi,

What you can do as an alternative is create a mountpoint for the new disk and mount it for additional storage. You can move the files that you want the fileserver to have access to to the new disk.

if i just create mountpoint for new disk,i need to add another map network drive to new shared folder on all of pc that use my file server. that the reason i ask how to get extra capacity from new disk for my /home partition,so i dont need to setting all client pc again.
WharfRat wrote:dimasyudi,

In order to create a logical volume for /home, you would first have to mark the disk partitions you intend to use as physical volume members. That will create a header on each partition. Then create a volume group adding all the physical volume to it . Finally you create the logical volume(s) and format it/them.

So in your case you will have to backup your /home and restore it to the logical volume and modify fstab to mount the lvm before booting.
thanks for the explanation,that's what i need but i have to search LVM tutorial 1st to understanding how to do it :D ,that's give me a reason to learn and learn again about linux



thanks for WharfRat and Ginsu543 for replying my question
altair4
Level 20
Level 20
Posts: 11460
Joined: Tue Feb 03, 2009 10:27 am

Re: upgrade capacity /home with new harddrive

Post by altair4 »

There is another alternative - bind.

Create a mount point for the "Data" partition at say .... /data as Ginsu543 suggested. Then bind the partition to your /home/$USER directory.

An example:

*** Create the /data mount point:

Code: Select all

sudo mkdir /data
*** Add a line with the correct UUID to /etc/fstab to have it automount - and I'm assuming it's an ext4 partition in this example:

Code: Select all

UUID=076426af-cbc5-4966-8cd4-af0f5c879646 /data ext4 defaults,noatime 0 2
*** Then have it mount:

Code: Select all

sudo mount -a
*** Make whatever permissions changes you wish to make after the partition is mounted at /data.

*** You have some options here but let's say you create another folder in your home directory:

Code: Select all

mkdir /home/dimasyudi/ServerStuff
*** Then to test this method out bind /data to /home/dimasyudi/ServerStuff:

Code: Select all

sudo mount --bind /data /home/dimasyudi/ServerStuff
/home/dimasyudi/ServerStuff should have been empty when you first created it but after the bind it will contain whatever is in /data with whatever permissions are present on /data.

If you shared only one subfolder of your home directory then you can create a subfolder in that and have it bind to that so that you don't have to alter any network maps. For example, let's say you shared your "Public" folder. The bind would look like this:

Code: Select all

sudo mount --bind /data /home/dimasyudi/Public/PublicSubFolder
If the bind idea works for you you can have it happen automatically at every boot: HowTo: Using Bind to Remount Part of a Partition.

Note: You may be tempted to use symlinks at this point because on the surface it seems easier to set up but if you are using Samba it won't work. Samba can't follow symlinks unless you do something that Samba doesn't recommend as it opens up a security vulnerability.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Beginner Questions”