20

I've got a new computer at the university and almost set up everything for myself on it when I've noticed that the previous user of the machine used a huge 1TB ext3 partition only.

I usually keep /home on a separate partition and I also prefer to use LVM, so I decided to shrink the partition using resize2fs and then create my usual LVM stuff in the space I freed up. (There is only about 30G of data on the whole hard drive, so it shouldn't be a problem).

I rebooted using a live CD and I asked resize2fs to shrink the partition to a more reasonable size (50G), and it seemed to move data around pretty intensively in the first quarter of an hour or so (judging from the noise of the hard drive).

Now it's been running for over three hours and practically no noise is heard from the HD, although the CPU usage is at 100%.

  1. Is this normal?
  2. Is resize2fs doing some intensive number crunching in the background for some reason and that's why I hear no noise from the HD?
  3. How much time should it take to resize the entire partition?
masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Tamás
  • 303
  • 1
  • 2
  • 6
  • 4
    Update: the whole process finished in a bit more than four hours, and yes, the HD was totally silent apart from the first 15 minutes or so. So, in a nutshell, this is totally normal. – Tamás Dec 19 '10 at 17:08
  • 1
    The same story as topic starter had. The whole process finished in 3+ hours hard disk was silent most time, but CPU was working hardly. So, if you have similar symptoms, please, be patient. –  Jun 13 '16 at 09:05

3 Answers3

14

Online resizing an ext4fs from 1 TB to 2 TB, on an RAID1 lvm2 took about 1h40min on a pair of seagate barracuta 2TB SATA drives. This was the root partition.

During this time, the CPU never went over 10% (cumulating md2_raid1 and md2_resize). The load was about 3.

If your resize2fs processes is eating 100% of your CPU and your HDD does not work, it really seems that it is stuck. Try to see if they are any (error) messages in the syslog.

Your setup is simpler (no RAID1 LVM), so it should have taken way less time, and during the process, your hard disk will work a lot, not your CPU.

Also, resize2fs has a -p flag (percentage), to display progression, but it is only in offline mode.

Christopher Cashell
  • 8,999
  • 2
  • 31
  • 43
megar
  • 267
  • 2
  • 6
  • 2
    I'm growing a partition in online mode right now and it seemed to have very low IO and CPU activity so I found this thread. megar's answer is useful to me since I now know not to panic that it's been going 20 minutes or more, but I also found that if I check the output of `df` a few times, the size of the partition is growing each time. Reassuring. I'm not sure if the same trick would show you progress in the same way while shrinking a partition, but worth a try. – tremby May 26 '13 at 23:47
9

The times can be variable depending on loads of different things.

If you think there is a problem, open a new window or create a new PuTTY session and run dmesg (I/O errors or some such) and/or df -h (whether available space is increasing).

I suspect it will take quite a while in any case. No idea how long, personally. You might be faster to copy it to another network drive and reinstall.

030
  • 5,731
  • 12
  • 61
  • 107
Glen M
  • 361
  • 1
  • 4
1

Another data point: resizing 1TB to 2TB, in online mode but system is single-user so activity very low, single SATA HDD, CentOS 6.7, took about 95 minutes.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • another data point Resize on Digital Ocean SSD from 300GB to 1T sudo resize2fs /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 resize2fs 1.42.13 (17-May-2015) Filesystem at /dev/disk/by-id/scsi-0DO_Volume_volume-nyc1-01 is mounted on /mnt/volume-nyc1-01; on-line resizing required gave up after 3+ hours and cycled power. e2fsck just hanged trying to detach volume also hanged, now my droplet is frozen and unreachable. – don bright Feb 19 '17 at 07:02