LinuxQuestions.org
Review your favorite Linux distribution.
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 09-05-2006, 08:25 PM   #196
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015

Yes, fdisk shows 1k blocks by default, so 37,535,841 blocks = 37,535,841,000 bytes. I never had df do what you report, that is report a different size than fdisk, so we'll have to mark it as a bug. Is the partition, /dev/hda1 reporting "no more space left on device"?, or can you write to it?
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-06-2006, 05:41 AM   #197
NapalmD
LQ Newbie
 
Registered: Apr 2006
Location: Portugal
Distribution: lots
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by AwesomeMachine
Yes, fdisk shows 1k blocks by default, so 37,535,841 blocks = 37,535,841,000 bytes. I never had df do what you report, that is report a different size than fdisk, so we'll have to mark it as a bug. Is the partition, /dev/hda1 reporting "no more space left on device"?, or can you write to it?
did I told you how I made this DD?
I only dd the /dev/sda1 to /dev/hda1, the hda was already partitioned by a previous debian install...
hda maintained the partition table, but sda1 is only 15GB, so dd only copied till 15GB... that might be the bug...

anyway i made this again:

Code:
Backups:~# dd if=/dev/zero > /etc/bigfile.file
dd: writing to `standard output': No space left on device
18488385+0 records in
18488384+0 records out
9466052608 bytes transferred in 241.634276 seconds (39175124 bytes/sec)

Backups:/etc# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1             15946992  15946992         0 100% /
tmpfs                   258272         0    258272   0% /dev/shm
 
Old 09-08-2006, 04:59 AM   #198
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Can you write to the device, or is it really full, as df says it is?
 
Old 09-08-2006, 05:42 AM   #199
NapalmD
LQ Newbie
 
Registered: Apr 2006
Location: Portugal
Distribution: lots
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by AwesomeMachine
Can you write to the device, or is it really full, as df says it is?
i is really full, i created a file but couldnt write to disk... with nano...
 
Old 09-08-2006, 02:41 PM   #200
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I think you didn't format the larger partition, so it is only formatted as 15 GB. If this is an ext3 file system, format it, and then try dd'ing the smaller partition to it. Better yet, format the larger partition, and copy the smaller partition over as a file in the new file system. Then, mount the file as a loop device, with a live CD (or the rescue option on the linux install CD), like this:

First mount the new drive that you formatted. It should be in /mnt:

mount /mnt/hda1

If not:

mkdir /mnt/hda1

mount /dev/hda1 /mnt/hda1


Then mount the image file you dd'ed to the new file system:

mkdir /mnt/image

mount -o loop /mnt/hda1/imagefile.img /mnt/image


and copy all the files and folders like so:

cp -r /mnt/image/* /mnt/hda1/

Then, umount the loop device:

umount /mnt/image

remove the imagefile.img:

rm imagfile.img

Use the distro installation CD to reinstall the grub boot loader,

and everything should work on the larger drive. It's good practice for when you really have a problem with linux. You need to know how to rescue a system with a CD,
or worse, a floppy.

Last edited by AwesomeMachine; 09-08-2006 at 05:33 PM.
 
Old 09-08-2006, 02:58 PM   #201
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
Put This On Tldp.org

Now!
 
Old 09-08-2006, 05:36 PM   #202
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Smile

Quote:
Originally Posted by itz2000
Put This On Tldp.org

Now!
I have contacted tldp.org by email, and asked them to make a link to this post within the "dd" documentation they have on their site.
 
Old 09-13-2006, 12:59 AM   #203
almagerenia
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
good job... big help to us...
 
Old 09-13-2006, 01:00 AM   #204
almagerenia
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
good job... huge help to everyone...
 
Old 09-17-2006, 01:31 PM   #205
gendoikari
LQ Newbie
 
Registered: Sep 2006
Distribution: xandros
Posts: 12

Rep: Reputation: 0
I'm a to linux but why would I use dd if im not installing 2 distros?
I hate windows( couldn't find one till now) but I'm not getting a new disk
 
Old 09-17-2006, 11:17 PM   #206
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Smile I'm not quite sure how to address this.

Quote:
Originally Posted by gendoikari
I'm a to linux but why would I use dd if im not installing 2 distros?
I hate windows( couldn't find one till now) but I'm not getting a new disk
Was there something unclear about the OP. Use of dd is not mandatory. You don't have to use it if you don't want to. You can do many things with Linux, including installing 2 distros, without using dd. Dd is a tool for when you need it. You don't use dd for everything. Now, if you read the OP, in its entirety, and you think you might have a use for dd, try it. I got interested in dd many years ago, when people had to write their own software no matter what. Software companies didn't exist, and the operating system had to do everything. That is when UNIX was written.

UNIX does everything, and very well. Linux is a UNIX clone, and Linux does everything, just like UNIX. That's because of a computer language called "C". C was written by the man who wrote UNIX. He wrote C in order to have a computer language with which to write UNIX. UNIX is the best operating system, and practically every enterprise uses it on some machines. If you know Linux you know UNIX. If you know UNIX you can get a job, anywhere in the world, making tons of money, at the drop of a hat. That's because UNIX is written in C, and all a person needs to do is write a C compiler, which is one program, and UNIX will install on any machine architecture. Any machine that has a C compiler can also run Linux, for free. That makes Linux one of then greatest things there is. The greatest things in life are free.
 
Old 09-18-2006, 03:28 AM   #207
kniwor
Member
 
Registered: Aug 2005
Distribution: Slackware 12
Posts: 106

Rep: Reputation: 15
k, i am patient, and curious, and i am not restless, and i have time, and i am still trying to learn DD properly, i have practially emptied one of My 40Gb to learn this thing, but still i am confused, help me with this...

> Say i had a file in my first filesystem (say FAT32), XXXXbytes just to say, call this file1, and say i know exactly where the file is placed on the HDD, i have another file in second filesystem (say ext2), same size, XXXXbytes, now i also know exactly where this file is kept, now using DD command, i overwrite file2 with file1, will it work, i mean will file2 just be garbage or become file one, will it work if both the filesystems are same, say ext2. (I am not copying the files using filenames, but i will use the Location on Harddisk, hope u understand, so the command looks like dd if=/dev/hda1 skip=...........)

> to be able to use the command more effectively i need to know what part of a HDD is reserved for what, i mean where is the partition tables, what place is reserved for what, where starts the data. Now i know u can brief me upon this, but as i said, i am patient, and would very much like to read something more detailed, descriptive, and easy....

and i am a newbie...be easy

Last edited by kniwor; 09-18-2006 at 03:30 AM.
 
Old 09-18-2006, 03:51 AM   #208
NapalmD
LQ Newbie
 
Registered: Apr 2006
Location: Portugal
Distribution: lots
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by AwesomeMachine
I think you didn't format the larger partition, so it is only formatted as 15 GB. If this is an ext3 file system, format it, and then try dd'ing the smaller partition to it. Better yet, format the larger partition, and copy the smaller partition over as a file in the new file system. Then, mount the file as a loop device, with a live CD (or the rescue option on the linux install CD), like this:

First mount the new drive that you formatted. It should be in /mnt:

mount /mnt/hda1

If not:

mkdir /mnt/hda1

mount /dev/hda1 /mnt/hda1


Then mount the image file you dd'ed to the new file system:

mkdir /mnt/image

mount -o loop /mnt/hda1/imagefile.img /mnt/image


and copy all the files and folders like so:

cp -r /mnt/image/* /mnt/hda1/

Then, umount the loop device:

umount /mnt/image

remove the imagefile.img:

rm imagfile.img

Use the distro installation CD to reinstall the grub boot loader,

and everything should work on the larger drive. It's good practice for when you really have a problem with linux. You need to know how to rescue a system with a CD,
or worse, a floppy.
well, I actually have formatted the large partition, cause I installed debian in there, only minimal install, but the installer partitioned the 40GB hard drive. then, I pick the drive and connected to the xp machine, installed drive on vmware program, and then dd'ed the sda1 to sdb1...
knowing this, do that tips above apply to my problem? cause I kinda didn't understand them correctly and I have this server in debian working already in production...
and will that cp work correctly, cause I tried once and it gave me a lot of hard link errors, and I have a lot of hard links used by backuppc program.
thanks
 
Old 09-19-2006, 01:16 AM   #209
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Original Poster
Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I believe there is a way to include hard and soft links in the cp command. If the server is working, I am glad. You don't need any more instructions from me if the machine is up and running. Congratulations!! :-)
 
Old 09-19-2006, 03:01 AM   #210
NapalmD
LQ Newbie
 
Registered: Apr 2006
Location: Portugal
Distribution: lots
Posts: 21

Rep: Reputation: 15
Quote:
Originally Posted by AwesomeMachine
I believe there is a way to include hard and soft links in the cp command. If the server is working, I am glad. You don't need any more instructions from me if the machine is up and running. Congratulations!! :-)
lol, it is working fine, despite that 15GB problem!
I have a temporary HD(80Gb) to put the 40GB data to fix this problem... sorry but I didnt understand correctly your last tips...
so 1st I need to put hda1 (15gb) in hdb1 in some way, but I need to create partitions 1st in this temporary HD right?
then will I need to format the hda1? how is that done?

then, transfer the data back to where it belongs but using all space provided by 37gb partition, how is that dd done?

I have read the 1st post, but it seems that it didnt work the way I liked. sorry but because I'm not good in english maybe I missed some word

thanks
 
  


Reply

Tags
backup, best, clonezilla, cloning, command, data, dd, disk, drive, duplicate, erase, explanation, formatting, ghost, hard, image, iso, memory, ping, popular, recover, recovery, rescue, search, security, stick, upgrade, usb, wipe


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
Learn The DD command AwesomeMachine Linux - Newbie 17 08-17-2006 04:22 AM
The best way to learn? iz3r Programming 7 02-06-2005 11:00 PM
Best way to learn Linux from the command line patpawlowski Linux - General 2 03-01-2004 03:37 PM
I want to learn C. KptnKrill Programming 14 12-18-2003 01:03 PM
Best way to learn.... InEeDhElPlInUx Linux - Newbie 5 10-11-2003 01:02 AM

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

All times are GMT -5. The time now is 01:15 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