You are not logged in.

#1 2017-08-12 16:54:48

Viis
Member
Registered: 2017-08-12
Posts: 3

Resizing root partition

While installing arch, I made a mistake and provide only 16G to root partition. Now I want to add +40G from /home to /root. Without loss of information. Is it possible? I read that since 2.6 kernel it's possible to resize partitions without booting from liveCD, but I can't find any appropriate instructions for it. They all say, that I need to umount /root and /home first, then run fsck, resize2fs and etc. But as far as I google it's not possible to umount /root without another /root.

And even if I'll run this procedure from liveCD I'm not sure that I'll not lose information from first gigabytes in /home. Does one of tools, mentioned earlier move data and saves it in /home?

$ sudo fdisk -l
Device        Start       End   Sectors   Size Type
/dev/sda1      2048   1048576   1046529   511M EFI System
/dev/sda2   1050624   8390655   7340032   3.5G Linux swap
/dev/sda3   8390656  41943040  33552385    16G Linux root (x86-64)
/dev/sda4  41945088 976773134 934828047 445.8G Linux home


It'll be terrible to lose 2 weeks or arch installation-configuration, so I sincerely hope you'll help.

Offline

#2 2017-08-12 17:05:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: Resizing root partition

gparted, offline (ie. from a live disc or usb key - that you *can* do this online doesn't mean it's a good idea)
Doing this w/o a backup is no good idea, but the jeopardized data is especially on sda4 in this case (since you want to expand sda3 into the sda4 range and offset the latter - the data on sda3 doesn't need to be touched)

Let me repeat: doing this w/o a backup is no good idea

Offline

#3 2017-08-12 17:15:21

Viis
Member
Registered: 2017-08-12
Posts: 3

Re: Resizing root partition

seth wrote:

Let me repeat: doing this w/o a backup is no good idea

tar cjvf backupHome.tar.gz /home/viis
tar cjvf backupRoot.tar.gz /root

Will it be enough in case of trouble?

Offline

#4 2017-08-12 17:43:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: Resizing root partition

More important than how you do the backup is where you store it. Same disk is a bad idea ;-)

Ensure to run those as UID0 since your user may/will lack read permissions on some files. Also /root is not / where you might have made adjustments on /etc and also if you loose /, you loose you precious arch installation efforts.

Do the backup of / (iff you intend so, the risk is low on sda3) offline to avoid backing up filesystems like /proc, /dev or /sys or even accidentally a mounted /home

Offline

#5 2017-08-19 15:10:38

Viis
Member
Registered: 2017-08-12
Posts: 3

Re: Resizing root partition

seth wrote:

More important than how you do the backup is where you store it. Same disk is a bad idea ;-)

Ensure to run those as UID0 since your user may/will lack read permissions on some files. Also /root is not / where you might have made adjustments on /etc and also if you loose /, you loose you precious arch installation efforts.

Do the backup of / (iff you intend so, the risk is low on sda3) offline to avoid backing up filesystems like /proc, /dev or /sys or even accidentally a mounted /home

Thanks for advise, seth. I successfully did what I want. For anyone who'll read this post later - be bold, if you have backup it's nothing to worry about.

Offline

Board footer

Powered by FluxBB