Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cgd on dk on 4k block size disk



tk%giga.or.at@localhost (Thomas Klausner) writes:

>sector-size=0x1000 == 4096 bytes.

>Am I misunderstanding something?

Here is the superblock data from a disk with 1k sectors,
2k fragments and 16k blocks.

bsize   16384   shift   14      mask    0xffffc000
fsize   2048    shift   11      mask    0xfffff800
frag    8       shift   3       fsbtodb 1

fsize == sectorsize << fsbtodb.


newfs prints the number of physical sectors and the partition size.

# newfs  -N /dev/rdk6
/dev/rdk6: 195312.5MB (200000000 sectors) block size 16384, fragment size 2048
        using 1060 cylinder groups of 184.27MB, 11793 blks, 23296 inodes.

200000000 sectors * 1024 bytes / sector = 195312.5MB

And fsck works fine with this filesystem.


You can test this with vnd by specifying a disk geometry.

% ls -l disk
-rw-r--r--  1 mlelstv  staff  8192000 May 29 00:17 disk
% sudo vnconfig vnd0 disk 4096/5/2/100
% sudo gpt show -l vnd0
  start   size  index  contents
      0      1         PMBR
      1      1         Pri GPT header
      2      4         Pri GPT table
      6    989      1  GPT part - "HotAir"
    995      4         Sec GPT table
    999      1         Sec GPT header
% sudo dkctl vnd0 listwedges
/dev/rvnd0d: 1 wedge:
dk8: HotAir, 989 blocks at 6, type: ffs
% sudo newfs dk8
/dev/rdk8: 3.9MB (989 sectors) block size 32768, fragment size 4096
        using 1 cylinder groups of 3.88MB, 124 blks, 256 inodes.
super-block backups (for fsck_ffs -b #) at:
8,
% sudo fsck -f dk8
** /dev/rdk8
** File system is already clean
** Last Mounted on 
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1 files, 1 used, 955 free (19 frags, 117 blocks, 1.0% fragmentation)
% sudo dumpfs -s dk8 | grep fsbtodb
frag    8       shift   3       fsbtodb 0
% sudo mount /dev/dk8 /mnt
% sudo chmod 1777 /mnt
% echo Hello > /mnt/world
% ls -la /mnt
total 18
drwxrwxrwt   2 root     wheel   512 May 29 00:34 .
drwxr-xr-x  25 root     wheel  1024 May 20 14:34 ..
-rw-r--r--   1 mlelstv  wheel     6 May 29 00:34 world
% sudo umount /mnt
% sudo fsck -f dk8
** /dev/rdk8
** File system is already clean
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
2 files, 2 used, 954 free (18 frags, 117 blocks, 1.9% fragmentation)
% uname -a
NetBSD pussyfoot 6.99.19 NetBSD 6.99.19 (PUSSYFOOT) #1: Wed May  1 10:30:36 
CEST 2013  
mlelstv@pussyfoot:/home/netbsd-current/obj.amd64/home/netbsd-current/src/sys/arch/amd64/compile/PUSSYFOOT
 amd64






Home | Main Index | Thread Index | Old Index