…with an open minded approach

(X/K/L) Ubuntu install: resizing ntfs partition takes too long (check ntfsresize progress, from console with strace)

Installing Lubuntu in a 2003 laptop, and had to resize the existing ntfs partition – after 2 hours of “resizing”, the linux installer was still in same picture, and we were waiting like blindlessly (the mouse moved, the window moved leaving a “trail”, but there was not indication of progress….)

So, after switching to a terminal with CTRL+F1, I could see from “top” that the program ntfsresize was running for 2hours and going… (it did not use much CPU or RAM dough, so it most certainly is an I/O speed bottleneck of the hardrive of the ntfs partition)

After more than 3 hours, I started to worry: what if in the end, I discover that something went wrong, and we have to restart it? what if we have to shutdown the pc before the end and risk destroying data?

So, with these inquietudes, I found that there is a way to snoop the stdoud and stderr of a running process – with strace

# I want to *snoop* the stdout(1) and stderr(2) of the process named 'ntfsresize'
# (run as root)
strace \
       -p $(pidof "ntfsresize")       \
       -e write=1,2   -e trace=write  \
       2>&1 | grep '(1'

…and it did it: ntfsresize is progressing, but it sure takes a LOT of time to finish (like 6 or 10 hours!)

Hope it helps

About these ads

4 Responses

  1. It helped! Rather than `grep ‘(1′`, I did `awk ‘/^write.*percent completed/ { print $3 }`. Works great either way :-) Much thanks.

    December 22, 2012 at 05:27

  2. This post was absolutely fantastic – perfect tip!!

    April 30, 2013 at 09:53

    • Glad you liked it :)
      It happened while installing Lubuntu to a friend, which was trying linux for the first time – not a good moment to see the computer “freeze”, I tried to explain him than linux very rarelly freezes… So this helped :)

      May 3, 2013 at 17:31

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.