|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
No linux system.
Anyway, I repartitioned the disk using Vista's tool and now it looks like this from OpenBSD: Code:
Disk: sd0 geometry: 32301/240/63 [488397168 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- *0: 07 0 32 33 - 203 74 26 [ 2048: 3072000 ] HPFS/QNX/AUX 1: 07 203 74 27 - 7137 239 63 [ 3074048: 104852512 ] HPFS/QNX/AUX 2: 0F 7138 1 63 - 30945 239 63 [ 107926685: 359976835 ] Extended LBA 3: 07 30946 178 19 - 32301 57 41 [ 467914752: 20480000 ] HPFS/QNX/AUX Offset: 107926685 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 06 7138 15 48 - 14073 22 6 [ 107927552: 104857600 ] DOS > 32MB 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused |
|
|||
It works fine form Vista's boot manager, no need for NeoGrub.
Great, thanks a lot! (In fact I was stuck, without running your command it would not work). By the way, why is it after restore /tmp is writable only by root? |
|
|||
I used dump and restore, using "restore -rf"
I did not compress the dumps, because they're not so big. /tmp ended up being only rx for group and others. Everything else seems to be fine Added: Now I have another little problem. Disklabel does not see my ext3 partition (I formatted it using gparted), it is seen fine by Vista though. And for some reason it suddenly does not see the third Lenovo partition: Code:
$ fdisk sd0 Disk: sd0 geometry: 32301/240/63 [488397168 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- *0: 07 0 32 33 - 203 74 26 [ 2048: 3072000 ] HPFS/QNX/AUX 1: 07 203 74 27 - 7137 239 63 [ 3074048: 104852512 ] HPFS/QNX/AUX 2: 0F 7138 1 63 - 30945 239 63 [ 107926685: 359976835 ] Extended LBA 3: 07 30946 178 19 - 32301 57 41 [ 467914752: 20480000 ] HPFS/QNX/AUX Offset: 107926685 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: A6 7138 15 48 - 14073 22 6 [ 107927552: 104857600 ] OpenBSD 1: 0F 14073 22 7 - 16153 176 32 [ 212785152: 31459328 ] Extended LBA 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 212785152 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 06 14073 54 39 - 16153 176 32 [ 212787200: 31457280 ] DOS > 32MB 1: 0F 16153 176 33 - 16431 65 17 [ 244244480: 4196352 ] Extended LBA 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 244244480 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 06 16153 209 2 - 16431 65 17 [ 244246528: 4194304 ] DOS > 32MB 1: 0F 16431 65 18 - 30945 223 15 [ 248440832: 219461632 ] Extended LBA 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 248440832 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 83 16431 97 50 - 30945 223 15 [ 248442880: 219459584 ] Linux files* 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Code:
$ disklabel sd0 # Extended partition 2: type 0F start 107926685 size 359976835 # Inside MBR partition 0: type A6 start 867 size 104857600 # /dev/rsd0c: type: SCSI disk: SCSI disk label: ST9250827AS flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 240 sectors/cylinder: 15120 cylinders: 32301 total sectors: 488397168 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 210688 107927552 4.2BSD 2048 16384 1 b: 8391600 108138240 swap c: 488397168 0 unused d: 4203360 116529840 4.2BSD 2048 16384 1 e: 6305040 120733200 4.2BSD 2048 16384 1 f: 10493280 127038240 4.2BSD 2048 16384 1 g: 20986560 137531520 4.2BSD 2048 16384 1 h: 54267072 158518080 4.2BSD 2048 16384 1 i: 3072000 2048 NTFS j: 104852512 3074048 NTFS Last edited by gosha; 11th August 2009 at 02:56 PM. |
|
|||
It is possible that the kernel doesn't recurse beyond the first extended partition table while creating fictitious label entries.
Why did you create so many in the first place? it looks very odd. |
|
|||
Quote:
|
|
||||
I believe there should only be 1 partition defined in each extended partition table. Two are to be unused and the other acts as a pointer to the next extended partition. So if you have a bunch of logical partitions you need a bunch of extended partitions to hold them.
|
|
|||
Ok, I usually cannot be satisfied until I get things working the way I want.
I reinstalled the original hard disk image with dd to have a clean start again. Then I partitioned with Gparted instead than using Vista. It seems that now both Vista and OpenBSD like the result. This is fdisk: Code:
Disk: sd0 geometry: 32301/240/63 [488397168 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- *0: 07 0 32 33 - 203 74 26 [ 2048: 3072000 ] HPFS/QNX/AUX 1: 07 203 74 27 - 7137 239 63 [ 3074048: 104852512 ] HPFS/QNX/AUX 2: 07 30946 178 19 - 32301 57 41 [ 467914752: 20480000 ] HPFS/QNX/AUX 3: 05 7138 0 1 - 30945 239 63 [ 107926560: 359976960 ] Extended DOS Offset: 107926560 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: A6 7138 1 1 - 14072 239 63 [ 107926623: 104857137 ] OpenBSD 1: 05 14073 0 1 - 16153 239 63 [ 212783760: 31464720 ] Extended DOS 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 212783760 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 83 14073 1 1 - 16153 239 63 [ 212783823: 31464657 ] Linux files* 1: 05 16154 0 1 - 16430 239 63 [ 244248480: 4188240 ] Extended DOS 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 244248480 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 82 16154 1 1 - 16430 239 63 [ 244248543: 4188177 ] Linux swap 1: 05 16431 0 1 - 30945 239 63 [ 248436720: 219466800 ] Extended DOS 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Offset: 248436720 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- 0: 83 16431 1 1 - 30945 239 63 [ 248436783: 219466737 ] Linux files* 1: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 2: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused 3: 00 0 0 0 - 0 0 0 [ 0: 0 ] unused Code:
# /dev/rsd0c: type: SCSI disk: SCSI disk label: ST9250827AS flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 240 sectors/cylinder: 15120 cylinders: 32301 total sectors: 488397168 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 211617 107926623 4.2BSD 2048 16384 1 b: 8391600 108138240 4.2BSD 2048 16384 1 c: 488397168 0 unused d: 4203360 116529840 4.2BSD 2048 16384 1 e: 6305040 120733200 4.2BSD 2048 16384 1 f: 10493280 127038240 4.2BSD 2048 16384 1 g: 20986560 137531520 4.2BSD 2048 16384 1 h: 54265680 158518080 4.2BSD 2048 16384 1 i: 3072000 2048 NTFS j: 104852512 3074048 NTFS k: 20480000 467914752 NTFS l: 31464657 212783823 ext2fs m: 4188177 244248543 unknown n: 219466737 248436783 ext2fs Thanks to you all. |
|
||||
I don't know why you bothered to assign your Linux swap partition to disklabel partition m.
I note there are three small gaps: 2048 sectors (1MB) is skipped at the beginning of the drive, before NTFS partition i, and again before partition j. 11232 sectors (5.4MB) is skipped between ext2fs partition (n) and your 3rd NTFS partition (k). |
|
|||
Quote:
Quote:
Well, I checked the original mbr (before ever using gparted, at that time I used Vista's tool to shrink its own partition, and the gap at the beginning of the drive was already there: Code:
$ cat mbr.fdisk.bak Disk: sd0 geometry: 32301/240/63 [488397168 Sectors] Offset: 0 Signature: 0xAA55 Starting Ending LBA Info: #: id C H S - C H S [ start: size ] ------------------------------------------------------------------------------- *0: 07 0 32 33 - 203 74 26 [ 2048: 3072000 ] HPFS/QNX/AUX 1: 07 203 74 27 - 22148 14 62 [ 3074048: 331804656 ] HPFS/QNX/AUX 2: 07 30946 178 19 - 32301 57 41 [ 467914752: 20480000 ] HPFS/QNX/AUX 3: A6 22148 14 63 - 30946 178 18 [ 334878704: 133036048 ] OpenBSD |
|
||||
You can do without any disklabel partition that you will never mount. The default install supports the ext2fs file systems with mount_ext2fs(8). The NTFS file systems can be mounted read only, with a custom kernel. If you don't plan to mount any foreign file systems, you do not need disklabel partitions describing them.
Quote:
|
|
|||
Quote:
Quote:
|
|
||||
*IF* there is no OpenBSD disklabel on the drive, OpenBSD will automatically assign MBR partition to disklabel partitions -- just as a convenience, so just in case the OpenBSD admin needs access to a foreign filesystem, he/she does not need to manually add them.
This happens only when there is no disklabel on the drive, and the disklabel is being created. If, after OpenBSD has been installed, new MBR partitions are added, they will not be added to the disklabel automatically. If any are needed, the admin must add them manually. So:
|
|
|||
Quote:
But this is not so clear to me: Quote:
|
|
|||
I'm going go try to simplify this a little more.. if that's even possible.
OpenBSD always addresses physical disks using disklabel partitions.. on a blank disk, the only partition would be 'c'. For every disk in the system, a "fake" or "fictitious" label is created within the kernel when no actual label exists on the drive. If you first booted OpenBSD's RAMDISK kernel, it created a fictitious label with foreign partitions mapped between i and p, after you added your OpenBSD partition and created your OpenBSD specific partitions, you kept the partitions mapped by the kernel in the disklabel you wrote to disk. Quote:
|
|
||||
Quote:
The disklabel's sector location varies by architecture. For i386/amd64, it is in the second sector of the OpenBSD MBR partition. If you move the location of the OpenBSD MBR partition on the drive, you will no longer have a valid disklabel. You used dump/restore. Were your OpenBSD partitions already in the disklabel, or did you have to recreate them? If you recreated them, that would indicate no disklabel found on disk. AFAIK, newfs(8), dump(8), and restore(8) will not touch the disklabel sector, which in this case, is part of your "a" partition. |
|
|||
Thanks a lot to both, things are much clearer now. Partitioning has always been some real black magic to me.
Quote:
And by the way, now I know why my /tmp had write permission only for root after restore, it is because I did not dump it at all, thinking I don't need to dump a partition that gets cleared on every boot. So I just made a fresh /tmp partition. While I'm here I have another question: does swap need to be formatted with newfs as any other filesystem? I did run newfs on it and it worked fine, but is it right? |
|
|||
No.. you do not run newfs(8) on your swap partition, it has no structure.. and no files are stored on it.
A swap partition has no defined format, it is just a contiguous space for the kernel to dump pages of memory until they're needed again. You should never write to a swap partition/file, you may end up corrupting data that was written.. fortunately the kernel doesn't care about previously written data after a reboot, so just do that. EDIT/NOTE: All data on the swap partition is encrypted, so hopefully the kernel is capable of detecting that a page has been corrupted and forces the program requesting the page to be terminated to prevent erratic behaviour, but I don't know if it does for sure. Last edited by BSDfan666; 13th August 2009 at 03:58 AM. |
|
|||
I see, thank you.
I modified the disklabel so that now it reads: b ... swap. I guess this should be enough? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Operating BSD partitions through XP | SunSpyda | OpenBSD General | 10 | 16th September 2009 08:22 PM |
How to swap partitions Help | revzalot | OpenBSD Installation and Upgrading | 2 | 1st September 2009 07:44 AM |
backup fdisk partitions | gosha | OpenBSD General | 17 | 16th July 2009 03:19 AM |
Moving ZFS partitions/drives between systems | corey_james | Guides | 2 | 6th August 2008 08:36 PM |
partitions | italogf | FreeBSD Installation and Upgrading | 5 | 7th July 2008 12:14 PM |