Re: dd problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 21, 2002 at 08:28:14AM -0700, Gangikunta Sreedhar wrote:
>   i wanted to make a boot floppy for my linux box.
> Inserted the floppy and typed 
> dd if=/boot/vmlinuz-2.4.10 of=/dev/hda1 bs=512.
> instead of typing of=/dev/fd0 and i wrongly typed
> of=/dev/hda1. 

Unix system administration, lesson #1:

Unix gives you enough rope to shoot yourself in the foot. Don't do
*anything* as root, unless you really need to.

Floppy access for normal users can be arranged by simply making dev/fd0
read/write for everybody (chmod 666 /dev/fd0), or by making the device
read/write for owner and group and adding users to the appropriate
group (adduser XXX floppy on a Debian system).

> After the command got exectued, i am not able to see
> any thing in my directories. Like when i type ls it is
> not showing and files. 
>   Please let me know how i can revert back to the
> original position.

You can't. There is a small chance that you can get some part back, but
you certainly can't get back to the original position.

> Any help is greatly appreciated.

Backup /dev/hda1 as a file on a different filesystem:

  dd if=/dev/hda1 of=file-on-different-fs bs=4k

Read and *understand* the manual pages of e2fsck, debugfs, and mke2fs.
Run a variaty of e2fsck, debugfs and mke2fs -S on the copy (*never* on
/dev/hda1). Make a new copy of the partition if necessary. The tools
will probably complain about the superblocks: backup superblocks can
usually be found at block number n*8192+1.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux