|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|
|||
Sector Issues on Dump/Clone of Embedded FW
Hi all,
Have an issue here. I have 2 drives that are marketed as being the same size 32G. However, the source drive is slightly larger than the target drive for the dump. Is there a way to make a change so that I can dump sd0 to sd1? sd0 (system drive) sd1 (target drive) Process so far: disklabel sd0 > /tmp/label.0 disklabel sd0 > /tmp/label.1 fdisk -i /dev/rsd1c disklabel -Rr /dev/rsd1c /tmp/label.0 (ERROR - unknown option -r???) removed -r from command disklabel -R /dev/rsd1c /tmp/label.0 (ERROR - disklabel: partition k: partition extends past end of unit) I took the c sector size from label.1 and replaced label.0 c sector size disklabel -e sd0 Code:
/dev/rsd0c: type: SCSI disk: SCSI disk label: Cruzer duid: a32277e951b9534c flags: bytes/sector: 512 sectors/track: 32 tracks/cylinder: 255 sectors/cylinder: 8160 cylinders: 7663 total sectors: 62530624 boundstart: 32 boundend: 62530080 drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 4202368 32 4.2BSD 2048 16384 1 # / b: 8608800 4202400 swap # none c: 62530624 0 unused d: 4202400 12811200 4.2BSD 2048 16384 1 # /tmp e: 8396640 17013600 4.2BSD 2048 16384 1 # /var f: 8396640 25410240 4.2BSD 2048 16384 1 # /usr g: 2105280 33806880 4.2BSD 2048 16384 1 # /usr/X11R6 h: 6299520 35912160 4.2BSD 2048 16384 1 # /usr/local i: 8396640 42211680 4.2BSD 2048 16384 1 # /usr/src j: 6299520 50608320 4.2BSD 2048 16384 1 # /usr/obj k: 5622240 56907840 4.2BSD 2048 16384 1 # /home # Notes: # Up to 16 partitions are valid, named from 'a' to 'p'. Partition 'a' is # your root filesystem, 'b' is your swap, and 'c' should cover your whole # disk. Any other partition is free for any use. 'size' and 'offset' are # in 512-byte blocks. fstype should be '4.2BSD', 'swap', or 'none' or some /tmp/EdDk.akDxsfJLpVV: unmodified: line 1 Code:
# /dev/rsd1c: type: SCSI disk: SCSI disk label: Cruzer duid: d8fd3d7968f58007 flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 3800 total sectors: 61056064 boundstart: 64 boundend: 61047000 drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] c: 61056064 0 4.2BSD 2048 16384 1 # Notes: # Up to 16 partitions are valid, named from 'a' to 'p'. Partition 'a' is # your root filesystem, 'b' is your swap, and 'c' should cover your whole # disk. Any other partition is free for any use. 'size' and 'offset' are # in 512-byte blocks. fstype should be '4.2BSD', 'swap', or 'none' or some # other values. fsize/bsize/cpg should typically be '2048 16384 16' for a # 4.2BSD filesystem (or '512 4096 16' except on alpha, sun4, ...) Thanks |
|
|||
I ended up using disklabel -E to manually partition the disk. All sizes are the same as the source drive... with a little stolen from home to adjust for the slightly smaller size.
I did notice that the offset default was 64 on the new drive, but the original source drive was 32 offset. I left it 64 to be safe. Now what would be the best way to backup: src drive > target drive? Would this be dump | restore one partition at a time and then use dd for partition k (/home) Thanks New disklabel -e sd1 Code:
/dev/rsd1c: type: SCSI disk: SCSI disk label: Cruzer duid: 4ba99503bda02123 flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 3800 total sectors: 61056064 boundstart: 64 boundend: 61047000 drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 4202368 64 4.2BSD 2048 16384 1 b: 8608800 4202432 swap c: 61056064 0 unused d: 4202400 12811232 4.2BSD 2048 16384 1 e: 8396640 17013632 4.2BSD 2048 16384 1 f: 8396640 25410272 4.2BSD 2048 16384 1 g: 2105280 33806912 4.2BSD 2048 16384 1 h: 6299520 35912192 4.2BSD 2048 16384 1 i: 8396640 42211712 4.2BSD 2048 16384 1 j: 6299520 50608352 4.2BSD 2048 16384 1 k: 4139104 56907872 4.2BSD 2048 16384 1 # Notes: # Up to 16 partitions are valid, named from 'a' to 'p'. Partition 'a' is # your root filesystem, 'b' is your swap, and 'c' should cover your whole # disk. Any other partition is free for any use. 'size' and 'offset' are # in 512-byte blocks. fstype should be '4.2BSD', 'swap', or 'none' or some # other values. fsize/bsize/cpg should typically be '2048 16384 16' for a # 4.2BSD filesystem (or '512 4096 16' except on alpha, sun4, ...) Last edited by daemonbak; 28th May 2017 at 04:13 AM. |
|
|||
dump | restore works pretty well. That's my primary local backup mechanism. And I have had to do a recovery, both of individual files as well as whole partitions.
I would have taken the extra space out of /tmp or some other partition you wouldn't actually backup/restore. Pretty much anything outside of /home /etc /var or /root. |
|
|||
I am doing the following now:
Code:
newfs /dev/sd1a mount /dev/sd1a /mnt (dump -0f - / )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1b newfs /dev/sd1d mount /dev/sd1d /mnt (dump -0f - /tmp )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1e mount /dev/sd1e /mnt (dump -0f - /var )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1f mount /dev/sd1f /mnt (dump -0f - /usr )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1g mount /dev/sd1g /mnt (dump -0f - /usr/X11R6 )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1h mount /dev/sd1h /mnt (dump -0f - /usr/local )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1i mount /dev/sd1i /mnt (dump -0f - /usr/src )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1j mount /dev/sd1j /mnt (dump -0f - /usr/obj )|(cd /mnt/; restore -rf -) umount /mnt; newfs /dev/sd1k mount /dev/sd1k /mnt (dump -0f - /home )|(cd /mnt/; restore -rf -) umount /mnt; f: /usr g: /usr/X11R6 h: /usr/local i: /usr/src j: /usr/obj |
|
|||
Hmm... Are you sure it's the data of the sub-partitions and not just the mount points?
|
|
|||
ls -alR shows it is the contents as well. Solved by:
mount / to /mnt && d /mnt && rm -rf tmp var usr... But there must be a more efficient way |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
5.8: fdisk(8) repaired to work on 4K sector disks again. | Martillo | OpenBSD Installation and Upgrading | 2 | 4th October 2015 12:24 PM |
Makefile for Vermaden's FreeBSD ZFS root install adapted for 4K sector disks | J65nko | Guides | 6 | 5th August 2013 08:51 PM |
Misc. BSD/UNIX BusyBox clone with a BSD license? | comet--berkeley | News | 1 | 3rd February 2012 09:21 AM |
Clonezilla Live clone system update | J65nko | News | 0 | 28th September 2011 05:53 PM |
how to remove boot sector viruses? | CyberJet | OpenBSD General | 8 | 15th July 2011 07:50 PM |