Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Mar 2005 15:03:19 -0300
From:      Alejandro Pulver <alejandro@varnet.biz>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Moving a slice
Message-ID:  <20050306150319.49fddd98@ale.varnet.bsd>

next in thread | raw e-mail | index | archive | help
Hello,

I have two IDE hard disks, the first has W2K and WXP, the second has a
GNU/Linux Debian Sarge (for booting purposes only) and a FreeBSD 5.3.

The Linux slice is the number 1, but the FreeBSD slice is number 4.
There is a long story behind this, when I was looking for UNIX like
Operating Systems (I had two Linux and one Linux Swap slices, but I
removed them). At the end I choose FreeBSD.

Here is my slice layout:

# fdisk -s
/dev/ad2: 79656 cyl 16 hd 63 sec
Part        Start        Size Type Flags
   1:          63    20466747 0x83 0x00
   4:    40949685    38909430 0xa5 0x80

# fdisk
******* Working on device /dev/ad2 *******
parameters extracted from in-core disklabel are:
cylinders=79656 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=79656 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 131 (0x83),(Linux native)
    start 63, size 20466747 (9993 Meg), flag 0
	beg: cyl 0/ head 1/ sector 1;
	end: cyl 1023/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 40949685, size 38909430 (18998 Meg), flag 80 (active)
	beg: cyl 1023/ head 0/ sector 1;
	end: cyl 1023/ head 254/ sector 63

There is a lot of free space after and before FreeBSD slice.

I would like to know if is possible to move the entire FreeBSD slice
(with 'dd', for example) to the end of the Linux slice, and then
change the starting point in the slice table, and then change '4' into
'2'. So there is no free space between the slices and the numbering is
correct.

I think 'dd' will not overrite some parts of the slice with others
because it is copying the data backwards, not forward.

Just for curiousity: Can I make 'dd' copy the data backwards (I mean,
the same result but instead of copying 1 to <dst>, 2 to <dst>+1,
etc.; copies <last> to <dst>, <last>-1 to <dst>+1, etc.)? Is possible to
make such modification to 'dd'? I plan to use this to move a slice
forward.

I guess I will have to use a bootable CD to boot a FreeBSD system (like
FreeSBIE) to move the slice.

Here are my results in bytes to pass to 'dd' (are they correct?):

Part	Start			Size
1:	32256			10478974464 (9993 Meg)
4:	20966238720 (19994 Meg)	19921628160 (18998 Meg)

What does the line "Warning: BIOS sector numbering starts with sector 1"
mean? It is an error?

Does the filesystem has to do with the phisical location of the slice
(according to the BSD label I think is does not, because it uses
offsets, not absolute values)?

Do I have to modify other file than '/etc/fstab' (like a loader
configuration file)?

I appreciate any recommendations/considerations/instructions/warnings.

Thanks and Best Regards,
Ale



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