Harddisk space extention

If none of the more specific forums is the right place to ask

Harddisk space extention

Postby Medcharaf » 2018-01-10 11:09

Hello everyone

I have this configuration on my server and I want to extend the sda3/md3 which is mounted on the root with the 1.8T from the /home how can I do that i'm new with linux thanks for ur help in advance

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 1,8T 0 disk
├─sda1 8:1 0 1004,5K 0 part
├─sda2 8:2 0 511M 0 part
│ └─md2 9:2 0 511M 0 raid1 /boot
├─sda3 8:3 0 19,5G 0 part
│ └─md3 9:3 0 19,5G 0 raid1 /
├─sda4 8:4 0 1,8T 0 part
│ └─md4 9:4 0 1,8T 0 raid1 /home
└─sda5 8:5 0 511M 0 part [SWAP]
sdb 8:16 0 1,8T 0 disk
├─sdb1 8:17 0 1004,5K 0 part
├─sdb2 8:18 0 511M 0 part
│ └─md2 9:2 0 511M 0 raid1 /boot
├─sdb3 8:19 0 19,5G 0 part
│ └─md3 9:3 0 19,5G 0 raid1 /
├─sdb4 8:20 0 1,8T 0 part
│ └─md4 9:4 0 1,8T 0 raid1 /home
└─sdb5 8:21 0 511M 0 part [SWAP]

thanks
Medcharaf
 
Posts: 2
Joined: 2018-01-10 11:06

Re: Harddisk space extention

Postby Seventh » 2018-01-10 11:32

you would have to reduce sda4/md4 to allow sda3 to grow.

From a live session maybe reduce sda4 in gparted and grow sda3 if able.

I have no experience in raid though, so this could be bad advice.
Seventh
 
Posts: 44
Joined: 2017-04-01 10:13

Re: Harddisk space extention

Postby steve_v » 2018-01-10 13:16

Seventh wrote:From a live session maybe reduce sda4 in gparted and grow sda3 if able.
AFAIK, gparted can't move md arrays. If a partition is detected as part of an array, gparted won't allow you to do anything with it.

I do know how to do this (assuming v1.2 mdadm metadata), but not without deleting md4 and its partitions...

Something like this, from a livecd:
Back up contents of md4.
Stop md3 & md4 if active.
Zero superblocks on sda4 & sdb4 (mdadm --zero-superblock).
Delete sda4 & sdb4.
Resize sda3 & sdb3 into free space (with parted, gparted will refuse to do it).
Start md3.
Expand md3 to the new partition size (mdadm --grow).
Resize the filesystem (resize2fs).
Recreate sda4, sdb4, md4, restore data.

Someone here may know how to non-destructively move raid partitions, but not me.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Harddisk space extention

Postby GarryRicketson » 2018-01-10 13:32

There is no 100% safe and non-destructively way to move raid partitions or any kind of partitions. Any time one starts moving and changing partitions there is
a risk that something will go wrong. The only way to guarantee you still have your original working system is to make a reliable , good back up first, test it,
make sure it is good.
Then if something goes wrong, you have something you can use to restore it.
Any partitioning tool , manual will tell you the same thing, back up the original
partitions first.
It is a good idea to practice a little first on some usb device, or a extra HD if you don't have any experience, but even so called experts, part of what makes the experts, they know how to make a back up, and do that first.
User avatar
GarryRicketson
 
Posts: 5187
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Harddisk space extention

Postby steve_v » 2018-01-10 14:14

Doesn't everyone have backups? I mean this box is supposedly a server, and running a server without backups is madness.
But yeah, mucking around at the partition level can hose all your stuff, obviously. Then again, doing anything as root can hose all your stuff.
steve_v
 
Posts: 695
Joined: 2012-10-06 05:31
Location: New Zealand

Re: Harddisk space extention

Postby Medcharaf » 2018-01-10 16:53

thank you for u advices and suggestion I will check this as soon as possible
Medcharaf
 
Posts: 2
Joined: 2018-01-10 11:06

Re: Harddisk space extention

Postby GarryRicketson » 2018-01-10 17:04

Postby steve_v » 2018-01-10 08:14
Doesn't everyone have backups?

Sadly, no, the forum is full of posts where the OP did not make a back uo, and
comes here asking us how to recover the "important data", they did not bother to save or back up.
Logic and common sense, and wisdom seems to be getting more and more scarce these days.

Your welcome,
I am not any kind of expert, in fact I kind of hate it if and when I have to do any resizing, or moving,... but there are a lot of pretty good tutorials that can be found with a search, off hand I don't have any particular links handy and a ton of other problems to deal with , but maybe later I can post some better info.
User avatar
GarryRicketson
 
Posts: 5187
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable