[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Low-level format / hd copying
On Wed, 6 May 1998, Itamar S.-T. wrote:
> Two questions:
>
> 1. How can I do a low-level format on a harddisk? I haven't been able to
> find a utility to do this.
that's a VERY serious step. I donno if such a util exists for linux, but I
sure as hell wouldn't trust a linux server installed on a disk that needed
a low-level format at any point in it's life.
>
> 2. If I want to make an exact copy of a harddisk, I should do something
> like
>
> dd if=/dev/sda1 of=/dev/sdb1 bs=1024
>
> right? If not, what is the best method (which would preserve pewmissions
> etc.)?
you could, if both partitions were the same size and both unmounted. I
copied entire 9 gig disks that way (partition table included, I did the
entire drive)
however if you need to do the root or a mounted directory it's really
tricky (you need to remount as read-only and other problems). I sugest
that you try "cp -a" for small directory trees, and tar for larger
directories or entire filesystems, as an example I'll copy root to a
second partition:
$ mount /dev/sdb1 /mnt/tmp1
$ cd /
$ tar clf - . | (cd /mnt/tmp1 ; tar xvpf - )
here I tar the root (keeping symlinks and dev files intact) but ONLY the
root (the "l" option means single filesystem, so I don't copy /home for
instance). the p in the untar stands for preserve permisions. there you
go...
--
Ira Abramov <ira(a)scso.com> whois: IA58 (a linux enthusiast)
`Don't be too proud of this technological terror you've constructed.'
-- Darth Vader