LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices


Reply
  Search this Thread
Old 06-10-2017, 02:51 PM   #1
martinlangley
Member
 
Registered: Nov 2008
Posts: 57

Rep: Reputation: 0
Using dd with a mounted drive


Hi all

I have a hackintosh based on an Acer box which is working fine.

In order to run Docker I need to boot with Yosemite. I have a Yosemite image, and these instructions to use:

"- Plug 8GB USB PENDRIVE and mount all partition of it (not eject)
- Use dd to transfer image to pendrive like this:
sudo dd if=~/Downloads/yosemite.img of=/dev/diskXX bs=1m
*** WHERE diskXX is your 8GB PENDRIVE, THIS PROCEDMENT ERASE ALL DATA OF YOUR PENDRIVE, IT IS IRREVERSIBLE!!!
- This take a few minutes, take a coffee
- Once dd finish write your PENDRIVE, you can reboot and boot with this pendrive"

(Author is Spanish)

I have had some success with an 8GB pendrive but it ran out of space. I am now using a 16GB but unmounting and doing the file transfer corrupts the usb partition.

Is it possible to do the dd with the partition mounted? If so how?

Thanks again, you guys are the best!

ML
 
Old 06-10-2017, 03:46 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,440

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
Quote:
Originally Posted by martinlangley View Post
In order to run Docker I need to boot with Yosemite. I have a Yosemite image, and these instructions to use:

"- Plug 8GB USB PENDRIVE and mount all partition of it (not eject)
- Use dd to transfer image to pendrive like this:
sudo dd if=~/Downloads/yosemite.img of=/dev/diskXX bs=1m
*** WHERE diskXX is your 8GB PENDRIVE, THIS PROCEDMENT ERASE ALL DATA OF YOUR PENDRIVE, IT IS IRREVERSIBLE!!!
- This take a few minutes, take a coffee
- Once dd finish write your PENDRIVE, you can reboot and boot with this pendrive"
That should almost certainly be, "unmount". It's bad enough to copy from a partition with dd while it is mounted (the image will have some mild, but correctable, filesystem corruption), but overwriting a partition with dd while it is mounted is sheer lunacy. Neither the filesystem that the kernel has mounted nor the image that you copied to the device will be intact.
 
Old 06-20-2017, 08:31 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,528

Rep: Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427Reputation: 2427
Not sure what you have exactly to begin with.
Not sure about the block size. (goes with above)
Not sure you have a disk image.

I've never wanted to use dd to a mounted drive. On accident a few times. Seems to go correctly but if some file is locking the drive or some program has a lock on it then you could have issues.

Had to check but this is the way it should be done. http://www.thelinuxdaily.com/2010/01...c-osx-with-dd/

I'd think there would be a sync option in macos dd command so you might wish to use it too.

Last edited by jefro; 06-20-2017 at 08:33 PM.
 
Old 06-21-2017, 01:41 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
that dd will erase everything on the pendrive, so there is no any reason to keep that filesystem mounted (it will be lost/overwritten/destroyed completely). Furthermore if anything was mounted during dd that may corrupt the copied image on the pendrive too (and you will not able to recognize that easily).
(if you have anything important on the pendrive, save it)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Restoring data after a dd command on wrong drive but this drive was previously mounted Hawezo Linux - Newbie 8 05-26-2017 10:00 AM
[SOLVED] second hard drive showing first drive / when mounted newbeliever Linux - Newbie 4 01-11-2015 07:11 PM
[SOLVED] MO drive can not be mounted nagib Linux - Hardware 12 11-01-2014 06:10 AM
Pen drive not mounted ...."Unable to mount, No media in drive" subashk80 Linux - Newbie 6 08-17-2009 01:38 AM
Can't keep CD drive mounted Allen Higgins Slackware - Installation 2 02-12-2008 03:21 PM


All times are GMT -5. The time now is 06:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration