Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Greetings everyone, I am new to linux, I have a hdd running win xp and Kubuntu(how I did it, I don't remember). My question is about dd.
I have a bootable 128MB CF card in a USB card reader, I want to back it up. I have used the following:
$ dd if=/media/disk of=/home/backup/test.iso
and this is the result:
dd: reading `/media/disk': Is a directory
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.001155 s, 0.0 kB/s
When I check the drive with Dolphin it doesn't give me the option of unmounting the CF drive, I believe the drive is /dev/sdb/sdb1.
I think /dev/sdb is mounted to /media/disk because I see the files and folders that I want to backup there.
What am I doing wrong?
I ran
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 1019:0c55 Elitegroup Computer Systems (ECS) USB Flash Reader, Desknote UCR-61S2B
Bus 002 Device 002: ID 043d:0072 Lexmark International, Inc. X6170 Printer
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub.
I think you want to read from the raw device, not the mounted directory. Thus, replace /media/disk with /dev/sdb1, and you should be good to go.
That is assuming /dev/sdb1 is the correct device. Check the output of the mount command (without arguments) to see what's mounted where. Look for the output relating to /media/disk.
dd.
I have a bootable 128MB CF card in a USB card reader, I want to back it up. I have used the following:
$ dd if=/media/disk of=/home/backup/test.iso
1. first find out the device name of your CF card (it used
to be /dev/sd[a-z] but it has changed recently).
Insert your card, wait for a few seconds then run this command:
cat /proc/partitions
Toward the end of the output in the last column you should see
your device name
For instance, on my computer
when I insert my digital camera memory card I get this
.... mmcblk0p1
2. now use dd on /dev/the_name_you_just_saw
In my case I would do this
cd
dd if=/dev/mmcblk0p1 of=backup.img
just replace by the device you got, and the name and location
of your output file
Greetings and thank all of you for your very prompt help, the 128MB CF was /dev/sdb,
I was able to copy it, the rewrite was slow but it worked.
I had to use sudo to get permission first.
I didn't write the bs=2048 when I copied it back
sudo dd if=/home/test.img of=/dev/sdb
does bs=2048 make it write faster?
How do I put this 128mb image on a 256MB or a 512MB CF
I am anxious to learn linux and leave my dependancy of windows.
I'm comfortable using the command line but, I don't know too many commands
I just wanted to throw in a friendly FYI: There's an *excellent* post/tutorial on LQ somewhere, by a member named 'Awesome Machine', titled 'Learn the dd command' or something very similar to this title.
It goes into detail of MANY examples of using dd to do lots of neat stuff!
How do I put this 128mb image on a 256MB or a 512MB CF
You just dd it to the device:
Code:
sudo dd if=/home/test.img of=/dev/sdc
but thereafter it'll be seen as a 128MB device (not 256 or 512MB) until you repartition it. There's no "harm" in this, it's just that dd copies over the partition table as well as the filesystem if you use it like this. So the 512MB device will (lie and) say it is only 128MB.
The first time I copied a partition to a file with dd, and then mounted that file as a filesystem (so I could read and write files from & to it) was a real eye-opener for me, as I realised I could never have done that with DOS / windows. So dd can be quite seductive, but always be very careful with the dd command making triply sure the destination is correct, or you'll hose some vital data.
Now I almost never use dd as there are usually better, safer, tools / methods to achieve what I want.
Explore, experiment (after backups, please), have fun and learn something new
And with that said: you can use parted or its graphical
cousin gparted to resize the migrated partition after the
fact .... (depending on the file-system on there, of course).
Out of curiosity:
What makes you use dd instead of e.g. a cp?
Greetings all, and thank you for your help.
I was able to copy the CF card, is there part of the dd command that can speed up the file transfer?
I don't use Linux much but I'm trying to do a complete move to Linux once I get the programs I use to work with it, I've tried WINE but not everything works with it, like an EPROM programmer connected to a PCI card parallel port and my Lexmark X6170 printer and other hardware.
I have Debian, Suse, Knoppix, Ubuntu disks around here but I installed Kubuntu and winxp on this machine.
Greetings all, and thank you for your help.
I was able to copy the CF card, is there part of the dd command that can speed up the file transfer?
Increasing the block-size should. bs=2048, for example...
But I'd like you to understand that you're NOT transferring
files, not even file-systems. You're copying the devices
content on a hardware-level.
And dd's default is to do that byte by byte, which isn't
the smartes choice for block-devices. Hence the suggested
block-size ... 2048 works well with most block-devices,
if it were a RAID with a large stripe-size you could up
that to e.g. 16384
Greetings, I did some tests on my CF card, I increased bs=8192 and went up to 32768 and found no difference in the speed after 8192, the transfer rate was 1MB/s did a 512MB card in 8 minutes.
I often use dd to copy whole windows-drives. I connect two HDs in on computer and boot with a slax live-CD.
With linux the only reason for copying raw data is when doing something with the masterbootrecord.
A linux system (other than windows) can be copied completely using "cp" since the system is "connected" to the harddrive only by /etc/fstab and the settings for the bootloader.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.