How to resize partitions on a live server
up vote
1
down vote
favorite
I purchased a 240G remote server and it has no control panel to change the way the server is partitioned so my root folder is locked to 20G. I have looked through many pages of google results and finally caved to ask here.
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.3M 3.2G 1% /run
/dev/sda2 20G 3.7G 15G 21% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 487M 79M 379M 18% /boot
/dev/sda3 200G 60M 190G 1% /home
I would like for the root to be larger than my home dir because thats where my programs are installed and use the space.
linux partitioning
New contributor
add a comment |
up vote
1
down vote
favorite
I purchased a 240G remote server and it has no control panel to change the way the server is partitioned so my root folder is locked to 20G. I have looked through many pages of google results and finally caved to ask here.
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.3M 3.2G 1% /run
/dev/sda2 20G 3.7G 15G 21% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 487M 79M 379M 18% /boot
/dev/sda3 200G 60M 190G 1% /home
I would like for the root to be larger than my home dir because thats where my programs are installed and use the space.
linux partitioning
New contributor
1
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
Can you please add the output offdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...
– tink
Nov 16 at 23:48
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I purchased a 240G remote server and it has no control panel to change the way the server is partitioned so my root folder is locked to 20G. I have looked through many pages of google results and finally caved to ask here.
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.3M 3.2G 1% /run
/dev/sda2 20G 3.7G 15G 21% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 487M 79M 379M 18% /boot
/dev/sda3 200G 60M 190G 1% /home
I would like for the root to be larger than my home dir because thats where my programs are installed and use the space.
linux partitioning
New contributor
I purchased a 240G remote server and it has no control panel to change the way the server is partitioned so my root folder is locked to 20G. I have looked through many pages of google results and finally caved to ask here.
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.3M 3.2G 1% /run
/dev/sda2 20G 3.7G 15G 21% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda1 487M 79M 379M 18% /boot
/dev/sda3 200G 60M 190G 1% /home
I would like for the root to be larger than my home dir because thats where my programs are installed and use the space.
linux partitioning
linux partitioning
New contributor
New contributor
edited Nov 16 at 16:05
New contributor
asked Nov 16 at 15:44
Snipey
62
62
New contributor
New contributor
1
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
Can you please add the output offdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...
– tink
Nov 16 at 23:48
add a comment |
1
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
Can you please add the output offdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...
– tink
Nov 16 at 23:48
1
1
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
Can you please add the output of
fdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...– tink
Nov 16 at 23:48
Can you please add the output of
fdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...– tink
Nov 16 at 23:48
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
- make a backup of home.
- umount home.
- Use a partitioning tool to shrink or delete and recreate a smaller home.
- Create and mount a new partition (parted is a command line tool)
If you can install vncserver and connect remotely you can install and use gparted.
Notes: changing the root volume when its mounted is either not permitted or only permitted with a small number of file systems.
Alternatives:
pretend sda3 is home
sda4 is new partition
- mount /dev/sda4 /temp
Now say the /usr folder is causing your root to be full.
As a precaution your should probably stop all or as many as possible running services.
- cp -r /usr /temp
- mv usr usr.old
- umount /temp
- mount /dev/sda4 /usr
verify that the contents match
Restart all services, as needed
modify /etc/fstab and or /etc/mtab as needed so the new partition automatically mounts on reboot.
Alternatively if your distro has a GUI tool feel free to use that.
reboot
If everything is correct delete usr.old
Technically you could copy all the files to your new partition. Then edit fstab and mtab so / points to /dev/sda4 and mount /dev/sda1 to a harmless folder like /useless. After rebooting and verifying everything still works you could delete or not mount /useless or maybe reuse it for something else like /var or /var/log.
Here's some commands I got from the website I listed in the comments.
gparted
print
select /dev/sda3
#delete home
rm 3 (or whatever print tells you the partition number is
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 20gb more that the start?
mkfs.ext4 /dev/sda3 (change the filesystem to whatever)
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 100gb (or etc)more that the start?
mkfs.ext4 /dev/sda4 (change the filesystem to whatever)
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
- make a backup of home.
- umount home.
- Use a partitioning tool to shrink or delete and recreate a smaller home.
- Create and mount a new partition (parted is a command line tool)
If you can install vncserver and connect remotely you can install and use gparted.
Notes: changing the root volume when its mounted is either not permitted or only permitted with a small number of file systems.
Alternatives:
pretend sda3 is home
sda4 is new partition
- mount /dev/sda4 /temp
Now say the /usr folder is causing your root to be full.
As a precaution your should probably stop all or as many as possible running services.
- cp -r /usr /temp
- mv usr usr.old
- umount /temp
- mount /dev/sda4 /usr
verify that the contents match
Restart all services, as needed
modify /etc/fstab and or /etc/mtab as needed so the new partition automatically mounts on reboot.
Alternatively if your distro has a GUI tool feel free to use that.
reboot
If everything is correct delete usr.old
Technically you could copy all the files to your new partition. Then edit fstab and mtab so / points to /dev/sda4 and mount /dev/sda1 to a harmless folder like /useless. After rebooting and verifying everything still works you could delete or not mount /useless or maybe reuse it for something else like /var or /var/log.
Here's some commands I got from the website I listed in the comments.
gparted
print
select /dev/sda3
#delete home
rm 3 (or whatever print tells you the partition number is
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 20gb more that the start?
mkfs.ext4 /dev/sda3 (change the filesystem to whatever)
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 100gb (or etc)more that the start?
mkfs.ext4 /dev/sda4 (change the filesystem to whatever)
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
add a comment |
up vote
1
down vote
- make a backup of home.
- umount home.
- Use a partitioning tool to shrink or delete and recreate a smaller home.
- Create and mount a new partition (parted is a command line tool)
If you can install vncserver and connect remotely you can install and use gparted.
Notes: changing the root volume when its mounted is either not permitted or only permitted with a small number of file systems.
Alternatives:
pretend sda3 is home
sda4 is new partition
- mount /dev/sda4 /temp
Now say the /usr folder is causing your root to be full.
As a precaution your should probably stop all or as many as possible running services.
- cp -r /usr /temp
- mv usr usr.old
- umount /temp
- mount /dev/sda4 /usr
verify that the contents match
Restart all services, as needed
modify /etc/fstab and or /etc/mtab as needed so the new partition automatically mounts on reboot.
Alternatively if your distro has a GUI tool feel free to use that.
reboot
If everything is correct delete usr.old
Technically you could copy all the files to your new partition. Then edit fstab and mtab so / points to /dev/sda4 and mount /dev/sda1 to a harmless folder like /useless. After rebooting and verifying everything still works you could delete or not mount /useless or maybe reuse it for something else like /var or /var/log.
Here's some commands I got from the website I listed in the comments.
gparted
print
select /dev/sda3
#delete home
rm 3 (or whatever print tells you the partition number is
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 20gb more that the start?
mkfs.ext4 /dev/sda3 (change the filesystem to whatever)
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 100gb (or etc)more that the start?
mkfs.ext4 /dev/sda4 (change the filesystem to whatever)
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
add a comment |
up vote
1
down vote
up vote
1
down vote
- make a backup of home.
- umount home.
- Use a partitioning tool to shrink or delete and recreate a smaller home.
- Create and mount a new partition (parted is a command line tool)
If you can install vncserver and connect remotely you can install and use gparted.
Notes: changing the root volume when its mounted is either not permitted or only permitted with a small number of file systems.
Alternatives:
pretend sda3 is home
sda4 is new partition
- mount /dev/sda4 /temp
Now say the /usr folder is causing your root to be full.
As a precaution your should probably stop all or as many as possible running services.
- cp -r /usr /temp
- mv usr usr.old
- umount /temp
- mount /dev/sda4 /usr
verify that the contents match
Restart all services, as needed
modify /etc/fstab and or /etc/mtab as needed so the new partition automatically mounts on reboot.
Alternatively if your distro has a GUI tool feel free to use that.
reboot
If everything is correct delete usr.old
Technically you could copy all the files to your new partition. Then edit fstab and mtab so / points to /dev/sda4 and mount /dev/sda1 to a harmless folder like /useless. After rebooting and verifying everything still works you could delete or not mount /useless or maybe reuse it for something else like /var or /var/log.
Here's some commands I got from the website I listed in the comments.
gparted
print
select /dev/sda3
#delete home
rm 3 (or whatever print tells you the partition number is
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 20gb more that the start?
mkfs.ext4 /dev/sda3 (change the filesystem to whatever)
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 100gb (or etc)more that the start?
mkfs.ext4 /dev/sda4 (change the filesystem to whatever)
- make a backup of home.
- umount home.
- Use a partitioning tool to shrink or delete and recreate a smaller home.
- Create and mount a new partition (parted is a command line tool)
If you can install vncserver and connect remotely you can install and use gparted.
Notes: changing the root volume when its mounted is either not permitted or only permitted with a small number of file systems.
Alternatives:
pretend sda3 is home
sda4 is new partition
- mount /dev/sda4 /temp
Now say the /usr folder is causing your root to be full.
As a precaution your should probably stop all or as many as possible running services.
- cp -r /usr /temp
- mv usr usr.old
- umount /temp
- mount /dev/sda4 /usr
verify that the contents match
Restart all services, as needed
modify /etc/fstab and or /etc/mtab as needed so the new partition automatically mounts on reboot.
Alternatively if your distro has a GUI tool feel free to use that.
reboot
If everything is correct delete usr.old
Technically you could copy all the files to your new partition. Then edit fstab and mtab so / points to /dev/sda4 and mount /dev/sda1 to a harmless folder like /useless. After rebooting and verifying everything still works you could delete or not mount /useless or maybe reuse it for something else like /var or /var/log.
Here's some commands I got from the website I listed in the comments.
gparted
print
select /dev/sda3
#delete home
rm 3 (or whatever print tells you the partition number is
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 20gb more that the start?
mkfs.ext4 /dev/sda3 (change the filesystem to whatever)
mkpart
primary
file system? whatever you want
start? don't know
end? don't know 100gb (or etc)more that the start?
mkfs.ext4 /dev/sda4 (change the filesystem to whatever)
edited 2 days ago
answered Nov 16 at 17:21
cybernard
9,63631423
9,63631423
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
add a comment |
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
I was trying to do it all via command line as to not install the bloated gui for linux
– Snipey
Nov 16 at 22:00
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
@Snipey Then use parted because its CLI. Good luck figuring it out.
– cybernard
Nov 16 at 22:12
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
That's where I am at now. Massive headaches....
– Snipey
Nov 16 at 23:14
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
@Snipey I am truly sorry to hear the pain your suffer, that is why I gave up and used the GUI. In opensuse there is yast disk which is a CLI gui, but I don't know if your distro offers any tools like that. Maybe this will help tecmint.com/… I googled it for you.
– cybernard
2 days ago
add a comment |
Snipey is a new contributor. Be nice, and check out our Code of Conduct.
Snipey is a new contributor. Be nice, and check out our Code of Conduct.
Snipey is a new contributor. Be nice, and check out our Code of Conduct.
Snipey is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1376028%2fhow-to-resize-partitions-on-a-live-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Did you purchase a physical machine? or are we talking about a remote server you have no physical access to? virtual maybe? Please edit the question and tell us more about the server.
– Kamil Maciorowski
Nov 16 at 15:47
It was a remote server and the panel does not provide a way to provision it the way I want.
– Snipey
Nov 16 at 16:05
Can you please add the output of
fdisk -l /dev/sda
? You may be able to, as suggested by @cybernard, resize (or remove) home, and simply extend root to a sensible size ...– tink
Nov 16 at 23:48