Меню Рубрики

Mac os dd progress

How can I track progress of dd

I am using the following command to create a bootable SD Card

Is there a way to track the progress?

6 Answers 6

The same information, displayed every second by in klanomath’s answer, can displayed using your command. You just need to enter a control T character from the keyboard while the dd command is executing.

By pressing the control T character, you are sending the same SIGINFO signal to the dd command that the command pkill -INFO -x dd sends.

As of coreutils 8.24, dd added a status options. Install coreutils with Homebrew to update dd.

dd itself doesn’t provide a progress bar. You may estimate the progress of the dd copy process by adding a pkill -INFO command though.

Which translates to a whopping 18.1 GB/s.

You can press Control + t while the dd command is running or for a nice progress bar you can install pv (pipe viewer) via Homebrew:

or (knowing size of the image, 16GB in this example):

Example output 2:

(data transferred, elapsed time, speed, progress bar and estimated time):

First of all, install Homebrew Package Manager. Then you have to install pv and dialog with this command:

You can then run this command to get a progress bar with the command:

but make sure to replace disk.img with the path to the image and diskX with your SD card’s disk identifier. If you want something more graphical, you can try this:

That is easy! For macOS High Sierra and below, just run a while loop and it will run until it is finished. Just make sure to do the code below in another window:

The code below will work out of box while in a firmware boot or within the full blown OS

while kill -0 $PID; do $(caffeinate -t 10) $(kill — INFO $PID) echo “still copying file” “$(date)”; done

^ To keep the machine awake (caffeinate) without the use of “homebrew” or tools not available in standard Mac OS X since homebrew requires internet and an actual OS to install it on.

NOTE: The above needs you to substitute the PID with your process ID and it will constantly show the progress

Источник

Quick: dd with progress indication on macOS

Dave Jansen

Read more posts by this author.

Dave Jansen

While newer versions of dd on Ubuntu or the like come with a new option called status=progress , the one included with macOS sadly does not.

A nice way I found to get progress indication whilst still being able to benefit from the huge speed increase in using /dev/rdiskX is to install a tool called pv , also known as Pipe Viewer.

Now, split up your dd command into two, and pipe everything through pv. If you know the size of the input drive, provide that to pv as-well as it will further improve the output. Take this example, where my input drive is 64GB:

sudo dd if=/dev/rdiskX bs=1m | pv -s 64G | sudo dd of=/dev/rdiskY bs=1m

This will result in a familiar looking progress indicator, as-well as an ETA and transfer speeds.

This method also works very well when zeroing out drives, something I had to do quite a lot recently as I was preparing to sell off some older drives. Using the following command for a 500GB drive, for example, worked great:

sudo dd if=/dev/zero | pv -s 500G | sudo dd of=/dev/rdiskY bs=1m

It’s quite useful to finally have some insight into how far along a task like this is, as it’s usually quite a time consuming one.

Alternative method: gdd (works, but slower)

Another way to achieve something similar would be to use brew to install coreutils , which will come with a newer version of dd that supports the status option.

brew install coreutils

All tools installed with this package are named with g prefixed to them, so you can run gdd to use this packages’ version of dd.

gdd if=/dev/diskX of=/dev/diskY bs=1m status=progress

Sadly, this version of dd lacks support for macOS’ «raw» disk support ( /dev/rdiskX ), which means it will be significantly slower to copy a disk over, but there might be certain scenarios where this method is preferred.

Источник

Как я могу отслеживать прогресс dd

Я использую следующую команду для создания загрузочной SD-карты

Есть ли способ отслеживать прогресс?

5 ответов

Такая же информация, отображаемая каждую секунду в ответе klanomath, может отображаться с использованием вашей команды. Вам просто нужно ввести символ T с клавиатуры, а dd команда выполняет.

Нажав символ control T , вы отправляете тот же SIGINFO к команде dd , что команда pkill -INFO -x dd отправляет.

dd сам не предоставляет индикатор выполнения. Вы можете оценить прогресс процесса копирования dd, добавив команду pkill -INFO , хотя.

Что переводится в колоссальные 18,1 ГБ /с.

Прежде всего, установите Менеджер пакетов Homebrew . Затем вам нужно установить pv и dialog с помощью этой команды:

Затем вы можете запустить эту команду, чтобы получить индикатор выполнения с помощью команды:

, но обязательно замените disk.img на путь к изображению и diskX с идентификатором диска вашей SD-карты. Если вы хотите что-то более графическое, вы можете попробовать следующее:

Это легко! Для macOS High Sierra и ниже просто запустите цикл while, и он будет работать до тех пор, пока он не будет завершен. Просто сделайте код ниже в другом окне:

Приведенный ниже код будет работать в ящике при загрузке прошивки или в полнофункциональной ОС

while kill -0 $PID; do $(caffeinate -t 10) $(kill — INFO $PID) echo “still copying file” “$(date)”; done

^ Чтобы машина не просыпалась (кофеин) без использования «доморощенного» или инструментов, недоступных в стандартной Mac OS X, поскольку для доморощенного требуется интернет и фактическая ОС для его установки.

ПРИМЕЧАНИЕ. Вышеупомянутое требует, чтобы вы заменили PID идентификатором процесса, и он будет постоянно показывать прогресс

Вы можете нажать Control + t , пока выполняется команда dd или для хорошего индикатора выполнения вы можете установить pv (просмотрщик каналов) через Homebrew:

или (знающий размер изображения, 16 ГБ в этом примере):

Пример вывода 2:

(переданные данные, прошедшее время, скорость, индикатор выполнения и расчетное время):

Источник

check the status of ‘dd’ in progress (OS X)

6 Alternatives + Submit Alt

«killall -USR1 dd» does not work in OS X for me. However, sending INFO instead of USR1 works. Show Sample Output

Your platform may not have pv by default. If you are using Homebew on OSX, simply ‘brew install pv’. Show Sample Output

While a dd is running in one terminal, open another and enter the while loop. The sample output will be displayed in the window running the dd and the while loop will exit when the dd is complete. It’s possible that a «sudo» will need to be inserted before «pkill», depending on your setup, for example: while pgrep ^dd; do sudo pkill -INFO dd; sleep 10; done Show Sample Output

display dd status on OSX (coreutils) every 10 seconds Show Sample Output

Observe the process of your dd command on Mac the Mac bash when you burn an .iso or .img on a SD-Card. This command avoids permission errors.

What Others Think

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What’s this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Similar Commands

Stay in the loop…

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes — that way only the great commands get tweeted.

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Источник

Как вы отслеживаете прогресс dd?

Если текст хранится как обычный текст внутри файла документа (независимо от того, состоит ли сам файл целиком из обычного текста), вы можете искать его из командной строки с рекурсивным grep. Это не требует индексации в первую очередь, но поиск по всем вашим файлам занимает очень много времени, поэтому, если вам понадобится сделать это более чем пару раз для всего вашего диска, вместо этого вы должны использовать утилиту поиска индексирования (как в этом answer). Откройте окно терминала (Ctrl + Alt + T). Измените каталог на вершину того, что вы хотите найти. Например, чтобы искать все в своем домашнем каталоге, сделайте cd

. Чтобы выполнить поиск всего на вашем компьютере, сделайте cd /. Для поиска всего на внешнем диске DocDrive do cd /media/DocDrive. Если каталог имеет пробелы в своем имени, заключите его в кавычки (например, cd ‘/media/Documents Drive’. Запустите рекурсивный grep следующим образом:

В качестве альтернативы вы можете пропустить шаг 2 и вместо cd в папку, в которую вы хотите заглянуть внутрь, замените . на шаге 3 именем папки, которую вы хотите просмотреть внутри.

Если вы хотите выполнить поиск по всем файлам, включая те, к которому вы обычно не имеете доступа, вы можете запустить grep в качестве обычного текста с помощью sudo:

16 ответов

Обновление 2016: Если вы используете GNU coreutils> = 8.24 (по умолчанию в Ubuntu Xenial 16.04 вверх), см. метод 2 ниже для альтернативного способа отображения прогресса.

Метод 1: Используя pv

Установите pv и поместите его между командами ввода / вывода только dd.

Примечание: вы не можете использовать его, когда вы уже начали [ f14].

Обновление 2016

pv — Pipe Viewer — это терминал-инструмент для мониторинга прогресса данных по конвейеру. Он может быть вставлен в любой нормальный конвейер между двумя процессами, чтобы дать визуальную индикацию того, как быстро проходят данные, сколько времени прошло, насколько оно близко к завершению, и оценить, как долго это будет до завершения.

Установка

Вы можете указать приблизительный размер с —size, если вы хотите оценить время.

Выход

Команда без pv будет :

Другое использование [ ! d27]

Вы можете, конечно, использовать pv для прямого вывода вывода на stdout:

Другие используют

[d32 ] Обратите внимание, что в этом случае pv автоматически распознает размер.

Способ 2: Добавлена ​​опция status в dd (GNU Coreutils 8.24 +)

dd в GNU Coreutils 8.24+ (Ubuntu 16.04 и новее) получил новую опцию status для отображения прогресса:

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Mac os dashboard отключить
  • Mac os dashboard как выключить
  • Mac os cpu benchmark
  • Mac os core keygen
  • Mac os contents папка