0

I have a debian server instance and I need to increase the root partition size of it. I installed the parted program and took a backup first. Then I attached another 2GB volume to the instance.

When I run "df" command it gives me this output.

Filesystem 1K-blocks Used Available Use% Mounted on rootfs 2063184 1726312 232068 89% / udev 10240 0 10240 0% /dev tmpfs 102288 88 102200 1% /run /dev/disk/by-uuid/3068f754-1f20-4436-8445-c287cc497619 2063184 1726312 232068 89% / tmpfs 5120 0 5120 0% /run/lock tmpfs 204560 0 204560 0% /run/shm 

In parted console when I run "print devices" command I got this.

(parted) print devices /dev/xvdb (2147MB) /dev/xvda (2147MB) 

When I run "print free" command I got this.

(parted)print free Model: Xen Virtual Block Device (xvd) Disk /dev/xvdb: 2147MB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 32.3kB 1049kB 1016kB Free Space 1 1049kB 2147MB 2146MB primary ext4 boot 

When I run "print all" in parted I got this.

(parted) print all Model: Xen Virtual Block Device (xvd) Disk /dev/xvdb: 2147MB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 1049kB 2147MB 2146MB primary ext4 boot 

So there are two devices. One is a free volume.I need to merge these two and make one root volume which has 4GB on it. So any one please tell me what is the command should I use in parted?

1 Answer 1

0

It sounds like you want to span the root volume across multiple disks, but it would be less dangerous and more maintainable in the long run to mount one of /usr, /home, or /var to the new disk.

  • temporarily mount the new disk
  • copy from the current /xxx directory to the new disk
  • rename the original directory temporarily to /xxx-old
  • update fstab to point /xxx at the new volume
  • reboot
  • if everything looks good, delete /xxx-old

The benefit to this approach is that it both frees up room on / and allows easier backups. You can put the data that is more important on the new volume and back that 2GB up when it changes rather having to back up all 4GB every time.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.