|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Changing fstype in disklabel (ext2fs -> 4.2BSD)
Hi,
This is the relevant line in /etc/fstab: Code:
fb4c0492275ba2e5.n /dataufs ffs rw,softdep,nodev,nosuid 0 0 # disklabel wd1 ):Code:
# /dev/rwd1c: type: ESDI disk: ESDI/IDE disk label: WDC WD3200AAKX-0 duid: fb4c0492275ba2e5 flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 255 sectors/cylinder: 16065 cylinders: 38913 total sectors: 625142448 boundstart: 50782208 boundend: 99610624 drivedata: 0 16 partitions: # size offset fstype [fsize bsize cpg] a: 2103744 50782208 4.2BSD 2048 16384 1 # / b: 4192993 52885952 swap # none c: 625142448 0 unused d: 1060256 57078976 4.2BSD 2048 16384 1 # /home e: 10474368 58139232 4.2BSD 2048 16384 1 # /tmp f: 5237184 68613600 4.2BSD 2048 16384 1 # /var g: 25759840 73850784 4.2BSD 2048 16384 1 # /usr i: 1951744 2048 ext2fs j: 48234438 1953819 unknown k: 3903488 99612672 unknown l: 13670400 103518208 ext2fs m: 390623232 117190656 ext2fs # /dataext n: 19529728 507815936 ext2fs # /dataufs o: 974848 527347712 ext2fs p: 3903488 528324608 ext2fs Obviously I should just change "ext2fs" to "4.2BSD" with # disklabel -e wd1 . That is:Before: Code:
n: 19529728 507815936 ext2fs # /dataufs Code:
n: 19529728 507815936 4.2BSD # /dataufs Looking at the other entries with fstype=4.2BSD (/, /home and so on), there are indeed 3 more fields (fsize, bsize and cpg). Questions: 1. Can I ignore the warning about too few fields? 2. fsize, bsize and cpg are missing -- are these the values printed by # dumpfs /dataufs ?3. How do I find out cpg (it is not shown by dumpfs)?
I could of course put # mount -t ffs -o ... /dev/wd1n /dataufs in rc.local, but I want to do it properly.One more thing: it is my understanding that the disklabels are only seen by OpenBSD. So any changes I make to /dev/wd1n (/dataufs) in disklabel -- such as changing the fstype -- will only affect how OpenBSD sees the disk; it will not change any data on the disk or affect FreeBSD (FreeBSD is on /dev/wd1j, and FreeBSD also uses the /dataufs partition). Is that correct? Reflecting on why this happens, I find this behavior a little strange. When the operating system boots, doesn't it just read /etc/fstab and call # mount on all the filesystems with the specified options? Yet # mount succeeds and /etc/fstab fails. So when the system boots, there must be an extra check that compares the filesystem type (in fstab) with the information in disklabel, and refuses to mount if they are not equal.
Last edited by soderlund; 9th November 2014 at 03:19 PM. Reason: UFS2 partition -> filesystem |
|
||||
Hello, and welcome.
It's not clear to me how a FreeBSD partition ended up in your OpenBSD disklabel as ext2. For those architectures that use MBRs -- among them amd64 and i386 -- this diagram shows a typical sector layout for drive sd0. The disklabel partition 'c' is used for the whole drive, but only a part of the drive may be used for the OpenBSD area, which is MBR partition type 0xA6.* Code:
biosboot : MBR : disklabel : : : 0 : 1 64 : 65 : 66 |=====|==========|=====|=====|===...===|====...===|==================> | | | -- sd0a --------------------------------> | | (unused) (superblock) ... | | | -- OpenBSD area -----------------------------------> | -- sd0c ------------------------------------------------------------> You will find the cpg value on the 11th line of your dumpfs(8) output. * diagram courtesy of naddy@ and otto@ in http://marc.info/?t=141507506600001&r=1&w=2 Last edited by jggimi; 9th November 2014 at 01:43 PM. Reason: typo. I can't post without at least one. |
|
|||
Thank you.
Quote:
Quote:
# dumpfs /dev/wd1n (excluding cg 0-249):Code:
magic 19540119 (FFS2) time Sun Nov 9 15:14:58 2014 superblock location 65536 id [ 5380a30b 6c19f1b4 ] ncg 250 size 9764864 blocks 8536788 bsize 8192 shift 13 mask 0xffffe000 fsize 1024 shift 10 mask 0xfffffc00 frag 8 shift 3 fsbtodb 1 minfree 8% optim time symlinklen 120 maxbsize 8192 maxbpg 1024 maxcontig 16 contigsumsize 16 nbfree 1063786 ndir 28 nifree 4895926 nffree 57 bpg 4892 fpg 39136 ipg 19584 nindir 1024 inopb 32 maxfilesize 8804691443711 sbsize 2048 cgsize 8192 csaddr 4984 cssize 4096 sblkno 72 cblkno 80 iblkno 88 dblkno 4984 cgrotor 51 fmod 0 ronly 0 clean 1 avgfpdir 64 avgfilesize 16384 flags soft-updates fsmnt /dataufs volname swuid 0 |
|
|||
Quote:
Code:
$touch -t 203801201234 y2k38-test |
|
|||
Hmm. I don't expect this disk to live for 24 more years (10 years is my current record), but let's figure out how to do it with FFS2 anyway. It could be a 2TB partition for someone searching in the future.
fsize and bsize are known but cpg does not exist? So a wild guess is that I should fill in fsize and bsize and omit cpg, like this: Code:
# size offset fstype [fsize bsize cpg] n: 19529728 507815936 4.2BSD 1024 8192 # /dataufs Code:
disklabel: line 31: too few fields re-edit the label? [y]: |
|
||||
Quote:
If I recall correctly, FFS 2 partitions are (currently) not bootable. When that becomes possible, you'll need to manage a root filesystem transition from the RAMDISK kernel, or you'll need to reinstall, in order to have an FFS 2 boot partition. Quote:
Quote:
Last edited by jggimi; 9th November 2014 at 08:23 PM. Reason: typos. |
|
||||
I suspect this is the root cause of where the ext2 came from. I'm not very familiar with parted, but the similar program Linux' fdisk does set the partition type to Linux by default. Likely GNU parted does the same? It might be a good idea to change that type as appropriate. Although that won't fix the consequences you see now, it may prevent similar ones in the future.
|
|
|||
I did like you said and it works now, jggimi. It's mounted at boot from fstab with no complaints. Thanks a lot for the help.
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DragonFly BSD disklabel program changes. | J65nko | News | 0 | 18th February 2010 01:59 AM |
Mounting an FS with no MBR/disklabel | Carpetsmoker | FreeBSD General | 2 | 10th December 2009 01:22 PM |
Disklabel problem | sateenkaari | NetBSD Installation and Upgrading | 3 | 13th August 2009 02:51 AM |
Moving linux partitions out of the BSD disklabel/slice | fbsduser | NetBSD Installation and Upgrading | 5 | 4th March 2009 07:07 AM |
disklabel don't see OpenBSD partition | piotrk | OpenBSD General | 4 | 25th September 2008 06:14 PM |