LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2013, 02:50 PM   #1
Chevymetal
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Rep: Reputation: Disabled
Total Newb - How to get DSK file onto SD Card


Hey Guys,

This may be a total newb question but I've searched until I'm about fed up.
Here's the deal:
1)I have a milling machine that runs it's programs by way of an SD Card that contains Linux files
2)Since all I have is a windows 7 computer, in order to backup this card I used LinuxReader and created a .dsk image file onto my hard drive

My question is: How can I put that .DSK file onto a new SD Card?

Thanks
 
Old 08-03-2013, 09:20 AM   #2
biodded
LQ Newbie
 
Registered: Dec 2012
Distribution: Knoppix, Xubuntu
Posts: 6

Rep: Reputation: Disabled
Question: are you talking just getting the file onto another SD card, or are you wanting to restore your SD card?

Assuming you want to restore the card, your best bet may be to use the dd utility. In linux, go to the command line, then find the .dsk file. At that point, you will need to figure out were the SD card is to your system. Most distros will likely auto-mount the SD card. This should allow you to look at the mount point. If you are luckly, the name of the folder will be something like /mnt/sdc1. If you can tell that this is your SD card, then you are good. This means that the SD card is represented to your system as /dev/sdc1 (or the like. Note that I am making up the sdc1). If not, someone else will likely have to tell you how to find the SD card (I will admit, I am a newb myself). Tell your system to unmount the SD card: you can either use "sudo umount <your SD card>, or you may be able to press the "eject" butten on a file manager. Issue "dd if=<your .dsk file> of=/dev/<your SD card>". Just remember, "if" stands for "input file" and "of" for "output file".

Note that the card should NOT be mounted when you go to actually restore the card.

Although you will likely find this everywhere, it is just as easy for me to type it up as it would be for you to find this, if you need it. If not, no worries.
In the command line, list the files in the directory using "ls", the change into the directory using "cd". Note that you can go up one directory with "cd .." If you ever get completely lost, "pwd" will tell you what directory you are in. I would cd to the directory that the .dsk is in, then just use "dd if=foo.dsk of=/dev/sdd1". Again, I am making up the file names, so you will need to find them in your system.
 
1 members found this post helpful.
Old 08-03-2013, 09:08 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by Chevymetal View Post
Since all I have is a windows 7 computer
Hmmm ... this is going to get awkward. The "dd" mentioned above is a Linux command.
That .dsk file is likely a disk image file - that Linuxreader is apparently just that; a reader only. There are Windows IFS drivers for ext filesystems available, but they are only for copying the files not an image like that .dsk

Best idea would be to get a Linux liveCD (runs from the CD without touching your Win7 system) so you can mount and manipulate that .dsk file - and "dd" it if that is actually what you really want to do.
Do you have Win7 software that will burn an image onto a CD ? Say Nero or "Windows Disk image burner" ?. There are freeware tools that'll do it fine - I've used infrarecorder for years.
 
1 members found this post helpful.
Old 08-03-2013, 09:09 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
not really sure what a .dsk file is (some sort of backup ?) ? can you please show us the output of:
file /name/of/.dsk/file

the dd advice above seems like what you would want. if you need help determining what drive is your sd card (dd is very destructive) please post the output of:
df -h
.

also like suggested above you can run a live-usb to boot the pc into a linux desktop and run your programs from there.

Last edited by schneidz; 08-03-2013 at 09:12 PM.
 
Old 08-05-2013, 06:55 AM   #5
Chevymetal
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Hmmm ... this is going to get awkward. The "dd" mentioned above is a Linux command.
That .dsk file is likely a disk image file - that Linuxreader is apparently just that; a reader only. There are Windows IFS drivers for ext filesystems available, but they are only for copying the files not an image like that .dsk

Best idea would be to get a Linux liveCD (runs from the CD without touching your Win7 system) so you can mount and manipulate that .dsk file - and "dd" it if that is actually what you really want to do.
Do you have Win7 software that will burn an image onto a CD ? Say Nero or "Windows Disk image burner" ?. There are freeware tools that'll do it fine - I've used infrarecorder for years.
I'll check out LiveCD as it sounds like what I probably need. I actually purchased Nero 12 Friday so I'm hopeful between the two that I can 'burn' this dsk file onto the SD card.
Thanks
 
Old 08-05-2013, 07:12 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Noooo - Nero will allow you to burn the liveCD (as an "image" - make sure you choose that option) .iso to a CD. Then you can boot that, as a Linux system.
The .dsk "image" you have is something different again - an unfortunate over-loading of the terminology. You won't be burning that.

After you have managed to burn the liveCD, and booted it successfully, post back again - this is going to need some care.
 
Old 08-05-2013, 08:47 AM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by Chevymetal View Post
I'll check out LiveCD as it sounds like what I probably need. I actually purchased Nero 12 Friday so I'm hopeful between the two that I can 'burn' this dsk file onto the SD card.
Thanks
what type of file is this dsk file ?; can you run the file command to if it is something that a linux system can recognize and identify the type.
 
Old 08-05-2013, 09:48 AM   #8
Chevymetal
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Noooo - Nero will allow you to burn the liveCD (as an "image" - make sure you choose that option) .iso to a CD. Then you can boot that, as a Linux system.
The .dsk "image" you have is something different again - an unfortunate over-loading of the terminology. You won't be burning that.

After you have managed to burn the liveCD, and booted it successfully, post back again - this is going to need some care.
Forgive me, I can sense I'm a bit over my head.
1) I feel I might be over complicating things so let me see if I can say this right -
2) The milling machine has a linux operating system with only an SD drive bay (no cd or floppy drive)
3) The files that control the operations of that milling machine come from the factory on an SD card
4) Every once in a while the files get corrupted which cost $450 for a new card everytime
5) I just want to duplicate that SD card to have as a backup
6) I have been able to access the files on the SD card using Windows 7 + DiskInternals Linux Reader and copied the files onto my hard drive
7) Then I simply transferred those files to a new SD card but when I plugged that SD card into my milling machine all it would do was show 'spool data...' and never did access any files
8) So from that, I concluded that I would need to copy an image of that SD card and all I had for that operation was DiskInternals which made a .dsk image that I now have on my windows hard drive
9) Now I need to get that .dsk file onto that sd card so that the linux system on the milling machine can read it

I hope that makes sense.
thanks again

Last edited by Chevymetal; 08-05-2013 at 10:02 AM.
 
Old 08-05-2013, 02:45 PM   #9
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ since the windows machine is creating the .dsk file (whatever that is) you will need to find a way to operate with that file using windows (i am not that well versed with windows so i wouldnt know how) ?

else you can boot your pc into a linux live-usb and get details on that file and report back to us.

maybe someone will have a clue as to a method of writing it back to the sd... i recomended dd.

Last edited by schneidz; 08-05-2013 at 02:46 PM.
 
Old 08-05-2013, 03:18 PM   #10
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally Posted by syg00 View Post
Hmmm ... this is going to get awkward. The "dd" mentioned above is a Linux command.
Pretty much all of the basic linux commands have been ported over to Windows.

http://www.chrysocome.net/dd
 
Old 08-05-2013, 03:42 PM   #11
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally Posted by Chevymetal View Post
...
I hope that makes sense.
thanks again
It sounds to me that the problem is with the filesystem type of your SD card rather than being able to copy it.

Please try this:

1) Put your SD card in your machine, or in another linux box, and let it mount (which means that the OS will create a connection between it and the filesystem on your card). If your CNC OS is locked down to the point where it won't allow you to browse your filesystem (via Control-Alt-F2, which will bring up a new session), then download one of the free linux flavors and boot into that (but don't install it if you don't want to).

2) Open a terminal (aka "dosbox" in the Windows world).

3) Run "df" to view the mounted filesystems.

On my box, it looks like this:

Code:
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda9       25803068  18336716   6155632  75% /
udev             1536624         4   1536620   1% /dev
tmpfs             618636      1068    617568   1% /run
none                5120         0      5120   0% /run/lock
none             1546588        80   1546508   1% /run/shm
/dev/sda2      337039712 216767020 120272692  65% /Win_C
/dev/sda1         203772     29096    174676  15% /Win_D
/dev/sda5         511720        16    511704   1% /Win_F16
/dev/sda11      37821788  27495260   8405268  77% /Sda11
/dev/sda7       25803068  22627792   2126700  92% /Sda7
/dev/sda8       25803068  10861616  13630732  45% /Sda8
/dev/sda6       31441904  10470176  20971728  34% /Win_F32
/dev/sdc1       15646632         8  15646624   1% /media/USB20FD
Note the last entry, it is my USB dongle mount on /media/USB20FD as device /dev/sdc1. This is what you are after.

Once you find where it is mounted (again, it might be easier to put a bootable linux CD in any PC and boot to that), we will then want to find out what filesystem type it is mounted under.

4) Run "sudo fdisk /dev/xxx" (replace "xxx" with the actual device letters - be sure to leave off any numbers since that is a partition, and not the partition table).

Mine looks like this: (please note that I added line comments to the listing. They start with "<---". Everything after that (including the "<---" is a comment made by me).

Code:
sudo fdisk /dev/sdc           <---I used "sdc" since it is where my USB dongle is mounted.
sudo password for johwaa:     <---Use yours, it will work better :)

Command (m for help): p       <---"p" for print the partition tables (and filesystem types)

...cut out for clarity

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1           10544    31334399    15661928    c  W95 FAT32 (LBA)  <---Notice that the filesystem type on the USB dongle is a Windows type filesystem.

Command (m for help): q       <---"q" for quit. Do not make any changes to your partition table. It will make it unreadable.
Please post what you have, and we can help you from there (are you making a duplicate SD card?, if so, you will want to prepare your blank SD card with the correct filesystem and then format it to that filesystem. Then run the "dd" command).

Last edited by rootboy; 08-05-2013 at 03:45 PM.
 
Old 08-05-2013, 03:54 PM   #12
Chevymetal
LQ Newbie
 
Registered: Aug 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rootboy View Post
It sounds to me that the problem is with the filesystem type of your SD card rather than being able to copy it.

Please post what you have, and we can help you from there (are you making a duplicate SD card?, if so, you will want to prepare your blank SD card with the correct filesystem and then format it to that filesystem. Then run the "dd" command).
Excellent. I will give that a go, and yes I am trying to make a duplicate SD card.
As soon as I tackle that I'll report back.

thanks
 
Old 08-05-2013, 03:58 PM   #13
vorbote
Member
 
Registered: Aug 2009
Location: 2,625 m of paranoia above sea level
Distribution: Arch Linux, Debian GNU/Linux, Fedora, Void Linux, FreeBSD, OpenBSD and Win10
Posts: 77

Rep: Reputation: Disabled
Quote:
Originally Posted by Chevymetal View Post
Hey Guys,

This may be a total newb question but I've searched until I'm about fed up.
Here's the deal:
1)I have a milling machine that runs it's programs by way of an SD Card that contains Linux files
2)Since all I have is a windows 7 computer, in order to backup this card I used LinuxReader and created a .dsk image file onto my hard drive

My question is: How can I put that .DSK file onto a new SD Card?

Thanks
I'm afraid no one has asked the obvious question: What application in windows did you use to create such .DSK file? WinDisk? WinImage? Something else? In my foggy recollections such utilities in windows usually have a way to write back those image files to a floppy, SHDC, HD, whatever. So use the same application used to create the image file to write it back to a different SD card. There should not be any mistery to this, just make sure the new card has at least the same size as the old one (and probably you should have asked in a Windows forum, TBH).

Last edited by vorbote; 08-05-2013 at 03:59 PM.
 
Old 08-06-2013, 08:48 PM   #14
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Rep: Reputation: Disabled
@Chevymetal

First thing: Make sure the write protect slider is in the "lock" position on the original SD card.

This is important because it is all too easy to write to the wrong (i.e. original source) SD card rather than the target card when using dd or any other duplicating software. That would be very bad!

Don't forget to return that slider to its original position when you return the card to the mill.

Live CD: I'd suggest "Parted Magic" or "Clonezilla" (but Clonezilla can be found on the Parted Magic CD anyway).

Go to http://distrowatch.com, scroll down to find Parted Magic and follow the download link (the latest version was released a week ago).
Clonezilla can also be found on that site but being a little older you would have to use the search boxes to find the last 2013 release.
A Clonezilla live CD has two advantages:
(1) It mostly only does cloning so it is less confusing.
(2) The .iso image is smaller so it takes less time to download and burn (Parted Magic has lots of useful stuff on it though).

dd will do a sector for sector copy so you don't have to worry about how the SD card was formated (Clonezilla is a front end to dd, makes it more user friendly but it does add some optimisations that could be problematic). Get the md5sum also (you will need that to check the downloaded .iso file has not been corrupted, not sure how to do that in Windows but the CD burning software may display it). Under Linux you can also use it to check the integrity of the burnt CD (I have no idea how to do that under Windows).

Just a word of caution: when using dd the input and output files (SD cards in this case) should not be mounted. These particular live CDs do not mount any drives (unless told to do so) with the exception of the CD drive itself. If you try this on a Linux computer (or a different live-CD) it probably will mount all the drives by default, you would have to unmount the SD cards before you could safely use dd on them. Clonezilla is faster than plain vanilla dd and it gives good feedback while dd tells you almost nothing but if the Clonezilla clone failed to work I'd go with dd for sure.

If you have two SD slots on your computer you can just do a disk to disk clone, otherwise you will need to create the intermediate image file. Clonezilla on either CD (if you pick the beginner option, I always do) will step you through the process with clear explanations (and lots of warnings).

Disclaimer: Although I have used Clonezilla and dd quite a lot I have never duplicated an SD card (I use them to clone hard disk drives). I'm no guru so if anyone finds something wrong with my advice please correct me/it (I won't mind at all).

Best regards dogphlap

Last edited by dogphlap; 08-07-2013 at 03:31 AM.
 
1 members found this post helpful.
Old 08-06-2013, 10:08 PM   #15
dogphlap
LQ Newbie
 
Registered: Aug 2013
Posts: 14

Rep: Reputation: Disabled
@Chevymetal

Try to make sure to clone the SD source card to an SD target card and not to a hard drive.
To state the obvious the target will be overwritten and anything that may have been on it before will go away.

When I look at an SD card on my computer it calls it sdb, but if I had two hard drives installed sdb would have been the second hard disk; so it is easy to mistake a hard drive for an SD card. The give away is the size. If you are running from a Parted Magic CD just opening the "File Manager" will show you the drives (left hand column), their sizes and what they are called. If anything seems ambiguous reboot the computer without the SD card(s), anything showing now obviously is not an SD card. SD cards are supposed to be hot swappable but I'd rather not risk it. If you are truly paranoid and it is not too difficult you could disconnect any hard drives before booting the computer (booting off a live-CD means you don't need them if you have enough ram).

I've made this all sound very hard but actually it is easy (once you have done it you will feel the same way).

Best regards dogphlap

Last edited by dogphlap; 08-07-2013 at 03:29 AM.
 
  


Reply



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
Extract a .dsk file peonuser Linux - Software 2 04-18-2011 11:32 PM
Total newb tacm General 2 01-18-2007 03:24 AM
ok ... i'm a total newb kreplech Linux - Newbie 4 05-27-2006 11:29 AM
Total NewB please Help? whitewizzard64 Linux - Networking 2 05-13-2005 09:53 AM
need Help with everything total newb EyeSeven Linux - Newbie 3 10-15-2003 01:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:07 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
Open Source Consulting | Domain Registration