Hi,
I noticed some odd things with volume labeling UFS filesystem. I was trying it on FreeBSD-8.2R. I prepared HDD "ad1" for one slice covers whole HDD with one partition via sysinstall. After slicing and bsdlabeling via sysinstall I have got:
Then I initialized UFS via newfs (not in sysinstall). I add switch -L to get partition with volume name "datadisk":
After that I've got label "datadisk" not for bsdlabel "d" but for slice "s1":
I found that if disk is prepared directly with bsdlabel (not via sysinstall) it works as I expect:
Then I changed to this:
I leave offset 16 of partition "e" set by bsdlabel. I continued with initializing UFS:
The volume was created as I expected only for partition "e":
It seems volume label doesn't work correctly when offset of partition is 0.
Could someone explain to me why volume not set to partition when partition offset is 0? And why sysinstall creates partition with offset 0 and bsdlabel normally creates offset 16?
I noticed some odd things with volume labeling UFS filesystem. I was trying it on FreeBSD-8.2R. I prepared HDD "ad1" for one slice covers whole HDD with one partition via sysinstall. After slicing and bsdlabeling via sysinstall I have got:
Code:
# bsdlabel /dev/ad1s1
# /dev/ad1s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 2096577 0 unused 0 0 # "raw" part, don't edit
d: 2096577 0 4.2BSD 0 0 0
Then I initialized UFS via newfs (not in sysinstall). I add switch -L to get partition with volume name "datadisk":
Code:
# newfs -UL datadisk /dev/ad1s1d
/dev/ad1s1d: 1023.7MB (2096576 sectors) block size 16384, fragment size 2048
using 6 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
with soft updates
super-block backups (for fsck -b #) at:
160, 376416, 752672, 1128928, 1505184, 1881440
After that I've got label "datadisk" not for bsdlabel "d" but for slice "s1":
Code:
# glabel status
Name Status Components
ufsid/4e3d65e8f0d63f14 N/A ad1s1
ufs/datadisk N/A ad1s1
# ll /dev/ufs
total 0
crw-r----- 1 root operator 0, 85 6 srp 18:03 datadisk [I][B]--> (ad1s1)[/I][/B]
crw-r----- 1 root operator 0, 87 6 srp 18:03 datadiskd [I][B]--> (ad1s1d)[/I][/B]
I found that if disk is prepared directly with bsdlabel (not via sysinstall) it works as I expect:
Code:
# fdisk -I /dev/ad1
******* Working on device /dev/ad1 *******
fdisk: invalid fdisk partition table found
fdisk: Class not found
# bsdlabel -w /dev/ad1s1
# bsdlabel -e /dev/ad1s1
# bsdlabel /dev/ad1s1
# /dev/ad1s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 2096561 16 unused 0 0
c: 2096577 0 unused 0 0 # "raw" part, don't edit
Then I changed to this:
Code:
# bsdlabel /dev/ad1s1
# /dev/ad1s1:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 2096577 0 unused 0 0 # "raw" part, don't edit
e: 2096561 16 4.2BSD 0 0 0
I leave offset 16 of partition "e" set by bsdlabel. I continued with initializing UFS:
Code:
# newfs -UL datadisk /dev/ad1s1e
/dev/ad1s1e: 1023.7MB (2096560 sectors) block size 16384, fragment size 2048
using 6 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
with soft updates
super-block backups (for fsck -b #) at:
160, 376416, 752672, 1128928, 1505184, 1881440
The volume was created as I expected only for partition "e":
Code:
# glabel status
Name Status Components
ufsid/4e3d671c32125d80 N/A ad1s1e
ufs/datadisk N/A ad1s1e
# ll /dev/ufs
total 0
crw-r----- 1 root operator 0, 85 6 srp 18:09 datadisk [B][I]--> (ad1s1e)[/I][/B]
It seems volume label doesn't work correctly when offset of partition is 0.
Could someone explain to me why volume not set to partition when partition offset is 0? And why sysinstall creates partition with offset 0 and bsdlabel normally creates offset 16?