NetBSD-Users archive

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

Re: newfs_msdos says vnconfiged device read-only, newfs doesn't say so



On Tue, 9 Aug 2022, Mayuresh wrote:

newfs_msdos says it's read-only:

   # newfs_msdos -F 32 /dev/rvnd0a
   /dev/rvnd0a: 4186096 sectors in 523262 FAT32 clusters (4096 bytes/cluster)
   MBR type: 11
   bps=512 spc=8 res=32 nft=2 mid=0xf0 spt=32 hds=64 hid=0 bsec=4194304 bspf=4088 rdcl=2 infs=1 bkbs=2
   newfs_msdos: /dev/rvnd0a: Read-only file system


Since the `a' and `d' slices are the same on vnd devices, you can use the
"whole disk" slice `d':

---
# dd if=/dev/zero of=i.img bs=1m count=1500
1500+0 records in
1500+0 records out
1572864000 bytes transferred in 2.408 secs (653182724 bytes/sec)
# vndconfig vnd0 i.img
# newfs_msdos -F 32 /dev/rvnd0d
/dev/rvnd0d: 3065976 sectors in 383247 FAT32 clusters (4096 bytes/cluster)
MBR type: 11
bps=512 spc=8 res=32 nft=2 mid=0xf0 spt=32 hds=64 hid=0 bsec=3072000 bspf=2995 rdcl=2 infs=1 bkbs=2
# mount -r -t msdos /dev/vnd0d /mnt
# umount /mnt
# vndconfig -u vnd0
---

But, as mlelstv@ pointed out, it's much safer if you treat the image as a
disk and create a GPT or a proper disklabel on it first.

-RVP


Home | Main Index | Thread Index | Old Index