Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
World of Warcraft

Novinky: Děkujeme všem návštěvníkům fóra, kteří ochotně radí ostatním. Vaše práce je velmi potřebná a vážíme si jí.

Autor Téma: backup celeho disku vcetne VTOC a filesystemu ..  (Přečteno 1061 krát)

SIGSEGV

  • Host
backup celeho disku vcetne VTOC a filesystemu ..
« kdy: 01 Prosinec 2010, 12:57:41 »
ahoj,

shodou okolnosti compaq me svym nemistnym dotazem privedl k jedne zajimave veci (diky mu zato), ve vypisu nize je patrne, jak vytvorit komplet backup celeho disku, kterej lze obnovit vc. oddilu a pripadne pripojit pres loop ..

dalsi komentar snad neni treba:

Citace
# fdisk -l /dev/sdc

Disk /dev/sdc: 2003 MB, 2003795968 bytes
32 heads, 63 sectors/track, 1941 cylinders
Units = cylinders of 2016 * 512 = 1032192 bytes
Disk identifier: 0x43591c34

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         195      196528+  83  Linux
/dev/sdc2             196         390      196560   83  Linux
/dev/sdc3             391        1941     1563408   83  Linux

# mkfs.ext3 /dev/sdc1 &>/dev/null

# yes y | mkfs.reiserfs /dev/sdc2 &>/dev/null

# mkfs.ntfs --fast /dev/sdc3 &>/dev/null

# mkdir -p /var/tmp/mount/{sdc1,sdc2,sdc3}

# cd /var/tmp/mount

# for x in *; do mount -vv /dev/$x /var/tmp/mount/$x; done
mount: no LABEL=, no UUID=, going to mount /dev/sdc1 by path
mount: you didn't specify a filesystem type for /dev/sdc1
       I will try type ext3
/dev/sdc1 on /var/tmp/mount/sdc1 type ext3 (rw)
mount: no LABEL=, no UUID=, going to mount /dev/sdc2 by path
mount: you didn't specify a filesystem type for /dev/sdc2
       I will try type reiserfs
/dev/sdc2 on /var/tmp/mount/sdc2 type reiserfs (rw)
mount: no LABEL=, no UUID=, going to mount /dev/sdc3 by path
mount: you didn't specify a filesystem type for /dev/sdc3
       I will try type ntfs
/dev/sdc3 on /var/tmp/mount/sdc3 type ntfs (rw)

# mount | grep sdc
/dev/sdc1 on /var/tmp/mount/sdc1 type ext3 (rw)
/dev/sdc2 on /var/tmp/mount/sdc2 type reiserfs (rw)
/dev/sdc3 on /var/tmp/mount/sdc3 type ntfs (rw)

# for x in *; do ps faux >$x/testfile; done
bash: sdc3/testfile: Permission denied

# umount sdc3; mount -t ntfs-3g /dev/sdc3 sdc3/

# for x in *; do ps faux >$x/testfile; done

# md5sum */testfile
8dab540bbadc9091fbb10fa79a1f9f26  sdc1/testfile
60f6cb885e814e5979bbff0a3cd6bb3f  sdc2/testfile
5aaa42efbdd1c313a4e6649a2c36b180  sdc3/testfile

# umount -vv *
Trying to umount /var/tmp/mount/sdc1
/dev/sdc1 umounted
Trying to umount /var/tmp/mount/sdc2
/dev/sdc2 umounted
Trying to umount /var/tmp/mount/sdc3
/dev/sdc3 umounted

# dd if=/dev/sdc of=/mnt/data/tmp/sdc.iso
3913664+0 records in
3913664+0 records out
2003795968 bytes (2.0 GB) copied, 99.5312 s, 20.1 MB/s

# losetup /dev/loop9 /mnt/data/tmp/sdc.iso

# losetup -a
/dev/loop9: [0806]:6471682 (/mnt/data/tmp/sdc.iso)

# kpartx -av /dev/loop9
add map loop9p1 (253:0): 0 393057 linear /dev/loop9 63
add map loop9p2 (253:1): 0 393120 linear /dev/loop9 393120
add map loop9p3 (253:2): 0 3126816 linear /dev/loop9 786240

# for x in 1 2; do mount -vv /dev/mapper/loop9p$x sdc$x; done
mount: no LABEL=, no UUID=, going to mount /dev/mapper/loop9p1 by path
mount: you didn't specify a filesystem type for /dev/mapper/loop9p1
       I will try type ext3
/dev/mapper/loop9p1 on /var/tmp/mount/sdc1 type ext3 (rw)
mount: no LABEL=, no UUID=, going to mount /dev/mapper/loop9p2 by path
mount: you didn't specify a filesystem type for /dev/mapper/loop9p2
       I will try type reiserfs
/dev/mapper/loop9p2 on /var/tmp/mount/sdc2 type reiserfs (rw)

# mount /dev/mapper/loop9p3 sdc3/ -t ntfs-3g

# md5sum */testfile
8dab540bbadc9091fbb10fa79a1f9f26  sdc1/testfile
60f6cb885e814e5979bbff0a3cd6bb3f  sdc2/testfile
5aaa42efbdd1c313a4e6649a2c36b180  sdc3/testfile

# umount -v *
/dev/mapper/loop9p1 umounted
/dev/mapper/loop9p2 umounted
/dev/mapper/loop9p3 umounted

# kpartx -vd /dev/loop9
del devmap : loop9p3
del devmap : loop9p2
del devmap : loop9p1

# losetup -d /dev/loop9

zdravim
« Poslední změna: 01 Prosinec 2010, 16:46:39 od ImmerDerBest »