Hello everyone,
I'm trying to write an OS image to a SD card. I'm following this guide: https://www.youtube.com/watch?v=ana7uz0l728
I ran the following command: sudo dd bs=1M if=XBian_2017.03.31_rpi3.img
I should have run the following command instead: sudo dd bs=1M if=XBian_2017.03.31_rpi3.im of=/dev/sdb
I do believe I may have written the image to sda instead of sdb. I panicked and turned off the computer . When I booted it looked like the operation completed (I feel really stupid). Feel free to make fun of me
This is what it shows when I run sudo fdisk -l:
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 976895 974848 476M 83 Linux
/dev/sdc2 978942 976771071 975792130 465.3G 5 Extended
/dev/sdc5 978944 352538623 351559680 167.7G 83 Linux
/dev/sdc6 352540672 938475519 585934848 279.4G 83 Linux
/dev/sdc7 938477568 976771071 38293504 18.3G 83 Linux
I know it should be showing /dev/sda instead of /dev/sdc. Can my screw up be fixed?
Thanks for the help
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Trying to write OS to SD card
-
- df -h | grep > 20TiB
- Posts: 1418
- Joined: 2012-10-06 05:31
- Location: /dev/chair
- Has thanked: 80 times
- Been thanked: 191 times
Re: Trying to write OS to SD card
dd without an output file (of=) doesn't write anything.Gordon wrote:I ran the following command: sudo dd bs=1M if=XBian_2017.03.31_rpi3.img
/dev/sd[x] disk nodes are not bound to a specific device, and which disk gets which label depends on detection order.Gordon wrote:I know it should be showing /dev/sda instead of /dev/sdc.
Use /dev/disk/by-id or /dev/disk/by-uuid if you want to be certain what's what.
What's actually "screwed up"? if it's just that sda became sdc, and the system is otherwise working ok, don't worry about it.Gordon wrote:Can my screw up be fixed?
If you can mount (or boot from) the device then it's fine.
If you did accidentally write to the wrong device the filesystem there will be trashed. Restore from backup.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
- sunrat
- Administrator
- Posts: 6495
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 476 times
Re: Trying to write OS to SD card
dd is not called disk destroyer for nothing. It will do what you tell it to, so be sure you are telling it the correct command. I always check to see what the system sees a removable disk as before proceeding. Immediately after inserting the device, check with
Code: Select all
dmesg |tail
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: Trying to write OS to SD card
Another way I like to use is to insert your device and runsunrat wrote:Immediately after inserting the device, check withCode: Select all
dmesg |tail
Code: Select all
lsblk
Re: Trying to write OS to SD card
Thanks for all the help. It looks like I didn't do any damage I will be more careful next time. My disk is also showing /dev/sda again.