Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2003 20:49:43 -0800
From:      Darren Pilgrim <dmp@pantherdragon.org>
To:        current@freebsd.org
Subject:   Problems creating and writing to disk slices
Message-ID:  <3E5069E7.6050106@pantherdragon.org>

next in thread | raw e-mail | index | archive | help
I've been trying to move the installed OSes around on my hard disk, but 
am having a huge amount of trouble doing so.

The task involves dd'ing the slices off the disk for safe-keeping, 
modifying the on-disk slice table, then dd'ing the slices back onto the 
disk in their new locations.  However, sysinstall doesn't work for 
manipulating the slice table and labels.  It gives me errors saying it 
couldn't write to the device.  Manually doing the work using fdisk and 
disklabel yield multiple problems:

- Fdisk returns device busy errors when trying to write to the slice 
table to make a modification to a slice that has no mounted filesystems.
I can only modify the slice table if I boot from either DOS or an 
off-disk OS (like the Fix-It CD).
- After the slice is created and I've rebooted back into 5.0p1, the lack 
of a /dev/ad4s1c device node means I have to use `disklabel -w -r ad4s1 
auto` to create the c partition, then `disklabel -e -r ad4s1` to modify 
the label.  The editor comes up with a label with the c partition offset 
of 0.  I add the other partitions making calculations to ensure the 
partitions start/end on boundaries.  Exiting the editor, disklabel 
complains that the 'c' partition doesn't begin with sector 0 and doesn't 
cover the whole disk, and also that my last partition goes past the end 
of the unit.  Reeditting the label, the offsets are now shifted by 63. 
Re-adjusting the partition sizes and offsets doesn't fix the problem 
even though the numbers indicate that everything is aligned properly and 
within the slice boundaries.

After growing quite frustrated with this, I gave up and booted into DOS 
and was able to create the slice.  Booting back into 5.0p1, fdisk tells 
me the slice is fine, and the size and geometry are an exact match to 
what I was trying to make fdisk use.  All that's left is to dd the 
original slice back into place, but `dd if=win98.ad4s1 of=/dev/ad4s1 
bs=1024k` returns an error saying that writing to ad4s1 failed because 
the device is busy.  How can the device be busy?

The above practices have worked fine for a long time in 4.x and still do 
even in 4.7p4, which is on this same machine.  The disklabel in 4.7p4 
doesn't complain about the state of the labels, and sysinstall can 
manipulate the slice table and labels just fine on the live disk. 
What's changed in 5.x to make this not work, and what do I need to do to 
accomplish my task?


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E5069E7.6050106>