Robert Watson | 1 Feb 2004 03:57
Picon
Favicon

Re: Analysis of mounts/unmounts issues.


On Sat, 31 Jan 2004, Pawel Jakub Dawidek wrote:

> Ok, I got complete solution. 
> 
> While I was looking on mksnap_ffs issue, I've found that we've MNT_USER
> flag to mark file systems mounted by unprivileged users.  This flag is
> not used currently. 
> 
> Patch is here: 
> 
> 	http://garage.freebsd.pl/patches/mount.patch
> 
> Patch made use of MNT_USER flag, so if file system is mounted by
> unprivileged root, it can be unmounted by him as well.  Mount(8) has
> been modified to print 'mounted by <user>' for unprivileged root also. 

I like this much better, and think the fix looks generally good.  I think
leaving mount/umount disabled in jail for now, regardless of the MNT_USER
fix, is a good idea to be on the conservative side, but it might well be
worth continuing to explore usermount in jail in the future.  The risk, as
already observed, is that jail's protections rely in large part on very
careful management of the file system namespace, and mount/umount on that
namespace implies a lot of risk. 

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert <at> fledge.watson.org      Senior Research Scientist, McAfee Research

_______________________________________________
freebsd-fs <at> freebsd.org mailing list
(Continue reading)

greg | 2 Feb 2004 02:33

Structure of UFS2 filesystem

I am looking for resources that describe the UFS2 filesystem structure.
I want to write some code that will pull a UFS2 filesystem back from the
dead. It has a bad Super Block, and no good Super Blocks can be found.
However, I sifted through the raw data on the disk, and my data is still
there.

Could somebody point me to documentation on this subject. I have tried
googling through the BSD filter. I received no useful results.

I looked at the source code for ffs, but it is a bit hard to read
without a basic understand of how the filesystem is structured.

If the tools I write are any good, I will make the source code available
under a BSD style licence.

Thank You,
--

-- 
greg <gval <at> mts.net>

_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Murata Shuuichirou | 2 Feb 2004 19:16

Re: updating HFS for 5.2R [patch]

In message <1074080151.733.51.camel <at> cyclops.thehouse>,
 `zgh <at> malfunktion.net' wrote:
> With these changes, the code compiles. I can install and load the
> resulting kernel module, and I can sucessfully use newfs_hfs and
> fsck_hfs, but mount_hfs on the same volume always fails with an
> "Input/output error".

If you have not gotten good results yet, try attached patch.  Of
course, your patch is also needed.

With this patch, I can mount hfs successfully.  Creating and
removing files on the filesystem are also succeeded.

But, I have not tested this fully and found some problems such as:

  1. Sometime, hfs partitions become unmountable by FreeBSD
     (mount_hfs returns "Invalid argument"), although the
     partition can still be mounted by MacOSX.

  2. After editing files on hfs filesystem with vi(1), umounting
     the filesystem causes these errors:

Feb  2 21:13:11 roma kernel: hfs_fsync: dirty: 0xc2d74000: tag hfs, type VREG, usecount 2, writecount 0,
refcount 2, flags (VV_SYSTEM), lock type cnode: EXCL (count 1) by thread 0xc2b42a80 (pid 1068)
Feb  2 21:13:11 roma kernel: tag VT_HFS, cnid 4, on dev 4, 24 lock type cnode: EXCL (count 1) by thread
0xc2b42a80 (pid 1068)
(lots of same errors continue)

     Then system crashed.

(Continue reading)

Niels Ole Salscheider | 3 Feb 2004 15:13
Picon

(unknown)

Hello,
I've just installed FreeBSD and configured some servers. But then I
recognized that my /-partition is too small.
Is there any way to change the size of pratitions without loosing data (to
make my /usr-partition smaller and my /-partition bigger)?

Thank you

Niels Ole Salscheider

begin 666 Niels Ole Salscheider (niels_ole <at> salscheider-online.de).vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..E-A;'-C:&5I9&5R.TYI96QS
M.T]L90T*1DXZ3FEE;', <at> 3VQE(%-A;'-C:&5I9&5R("AN:65L<U]O;&5 <V%L
M<V-H96ED97(M;VYL:6YE+F1E*0T*5$5,.TA/344[5D])0T4Z*S0Y(" <at> P,C(Q
M*2 U,#$V.3 <at> -"D%$4CM73U)+.CL[.T]B97)E($1O<F9S='(N(#$V.SL[1&5U
M='-C:&QA;F0-"DQ!0D5,.U=/4DL[14Y#3T1)3D<]455/5$5$+5!224Y404),
M13I/8F5R92!$;W)F<W1R+B Q-CTP1#TP041E=71S8VAL86YD#0I54DP[5T]2
M2SIH='1P.B\O=W=W+G-A;'-C:&5I9&5R+6]N;&EN92YD90T*14U!24P[4%)%
M1CM)3E1%4DY%5#IN:65L<U]O;&5 <V%L<V-H96ED97(M;VYL:6YE+F1E#0I2
 <at> 158Z,C P-# Q,C!4,3<R,3 S6 <at> T*14Y$.E9#05)$#0H`
`
end

_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

Zack Hobson | 4 Feb 2004 05:00

Re: updating HFS for 5.2R [patch]

On Mon, 2004-02-02 at 10:16, Murata Shuuichirou wrote:
> In message <1074080151.733.51.camel <at> cyclops.thehouse>,
>  `zgh <at> malfunktion.net' wrote:
> > With these changes, the code compiles. I can install and load the
> > resulting kernel module, and I can sucessfully use newfs_hfs and
> > fsck_hfs, but mount_hfs on the same volume always fails with an
> > "Input/output error".
> 
> If you have not gotten good results yet, try attached patch.  Of
> course, your patch is also needed.

This is great news, thanks. There is no way I would have figured that
out myself. Can you give me any insight into why the changes you made
were needed?

Anyway, the problems that you're encountering now probably have to do
with the fact that I did not properly update some of the locking code in
my patch, I simply worked around it to get it to compile. The B_LOCKED
(AFAIR) flag disappeared and I worked around the problem by simply
defining it in my own code.

I think your changes exposed this ugly hack of mine, but this is great
news! Now all I need to do (hopefully) is figure out what to use instead
of the now-obsolete B_LOCKED flag. Anyone have any ideas?

Thanks and regards,

-zack

_______________________________________________
(Continue reading)

Philippe Dorman | 6 Feb 2004 20:32

WD160 + Drive geometry problem

Hiya,

I recently got a 160 gig hard drive, it seems to be mounted
properly, partitions and slices "seem" fine, yet I cant write more than 2k
to the disk, it's just as if there wasn't any free space left. I'm using a
Promise Ultra ATA/133 controller, which does support drives greater than 137
gigs so that shouldn't be the problem. I'm running 5.1-Current. Here's the
output to a couple commands 

First from dmesg

ad4: 19546MB <FUJITSU MPG3204AT E> [39714/16/63] at ata2-master UDMA100
ad5: 76319MB <WDC WD800BB-00CAA1> [155061/16/63] at ata2-slave UDMA100
ad6: 39205MB <Maxtor 6E040L0> [79656/16/63] at ata3-master UDMA133
ad7: 152627MB <WDC WD1600JB-00EVA0> [310101/16/63] at ata3-slave UDMA100

df

Filesystem  1K-blocks     Used     Avail Capacity  Mounted on
/dev/ad4s1a    253678   251702    -18318   108%    /
devfs               1        1         0   100%    /dev
/dev/ad4s1e    253678        2    233382     0%    /tmp
/dev/ad4s1f  18121388  2997228  13674450    18%    /usr
/dev/ad4s1d    253678    33436    199948    14%    /var
/dev/ad7s1  151368706        2 139259208     0%    /hd1
/dev/ad6s1   38879438 32184422   3584662    90%    /hd2
/dev/ad5s1   75685352 69630522         2   100%    /hd3

Then disklabel ad7s1 (starts to get interesting here - 8 partitions?)

(Continue reading)

Doug White | 7 Feb 2004 08:13

Re: WD160 + Drive geometry problem

On Fri, 6 Feb 2004, Philippe Dorman wrote:

> I recently got a 160 gig hard drive, it seems to be mounted
> properly, partitions and slices "seem" fine, yet I cant write more than 2k
> to the disk, it's just as if there wasn't any free space left. I'm using a
> Promise Ultra ATA/133 controller, which does support drives greater than 137
> gigs so that shouldn't be the problem. I'm running 5.1-Current. Here's the
> output to a couple commands

Well, there isn't since you're using the auto partition defaults and
filling up /.

> /dev/ad4s1a    253678   251702    -18318   108%    /

oops.

> /dev/ad5s1   75685352 69630522         2   100%    /hd3

Oops again.

Try deleting some files.

--

-- 
Doug White                    |  FreeBSD: The Power to Serve
dwhite <at> gumbysoft.com          |  www.FreeBSD.org
_______________________________________________
freebsd-fs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe <at> freebsd.org"

(Continue reading)

Amit Khivesara | 4 Feb 2004 21:07

Msdos fsync


Hi,

The fsync for msdos does not seem to sync the FAT entries.
Hence the file can be corrupted if the syncer has not come in
and synced the entries.
If anyone is interested I have added a function fat_sync
to do this. This will allow the msdos fsync really "sync" the file.
The diffs are given below for kernel 4.1.1.

I am new to this mailing list.
If this is a unappropriate post, then let me know.

khivi

diff msdosfs/fat.h msdosfs.new/fat.h
106a107

 >> void fat_sync __P((struct vnode * , struct denode *dep));

diff msdosfs/msdosfs_fat.c msdosfs.new/msdosfs_fat.c
325a326,398

 >>  * Sync the fat cache in denode dep of all entries relating to file
 >>  */
 >> void
 >> fat_sync(vnode,dep)
 >>  struct vnode *vnode;
 >>  struct denode *dep;
 >> {
(Continue reading)

Ion-Mihai Tetcu | 7 Feb 2004 14:58
Picon
Favicon

Painful speed for copying to fat32 partitions with small cluster size.

Hi,

Does anyone know why this happens or what to do ?

Setup: UDMA133 primary master, UFS2; UDMA100 secondary master, FAT32.

Copying to FAT32 partitions is very slow with small cluster sizes (I was
copying some 300 - 700MB files):

FAT32 clustersize=4K	500KB/s
FAT32 clustersize=32K	3.5MB/s
FAT32 clustersize=64K	6.2MB/s
FAT32 clustersize=128K	6.4MB/s
FAT16			6.5MB/s

Reading speed is the same.

Same experience for newfs_msdos: on a 10G partition:

itetcu <at> it> /home/itetcu [16:23:40] 0
# newfs_msdos -F32 -b32768  /dev/ad2s2
/dev/ad2s2: 20959616 sectors in 327494 FAT32 clusters (32768 bytes/cluster)
bps=512 spc=64 res=32 nft=2 mid=0xf0 spt=63 hds=16 hid=0 bsec=20964825 bspf=2559 rdcl=2 infs=1 bkbs=2
itetcu <at> it> /home/itetcu [16:24:51] 0
#
itetcu <at> it> /home/itetcu [16:28:56] 1
# newfs_msdos -F32 -b65536 /dev/ad2s2
/dev/ad2s2: 20962176 sectors in 163767 FAT32 clusters (65536 bytes/cluster)
bps=512 spc=128 res=32 nft=2 mid=0xf0 spt=63 hds=16 hid=0 bsec=20964825 bspf=1280 rdcl=2 infs=1 bkbs=2
itetcu <at> it> /home/itetcu [16:29:23] 0
(Continue reading)

Bruce Evans | 7 Feb 2004 23:19
Picon

Re: Painful speed for copying to fat32 partitions with small cluster size.

On Sat, 7 Feb 2004, Ion-Mihai Tetcu wrote:

> Does anyone know why this happens or what to do ?
>
> Setup: UDMA133 primary master, UFS2; UDMA100 secondary master, FAT32.
>
> Copying to FAT32 partitions is very slow with small cluster sizes (I was
> copying some 300 - 700MB files):
>
> FAT32 clustersize=4K	500KB/s
> FAT32 clustersize=32K	3.5MB/s
> FAT32 clustersize=64K	6.2MB/s
> FAT32 clustersize=128K	6.4MB/s
> FAT16			6.5MB/s
>
> Reading speed is the same.

Lots of things are suboptimal, including your disk apparently not liking
small writes (or reads?).

Try this patch:

%%%
Index: msdosfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/msdosfs/msdosfs_vnops.c,v
retrieving revision 1.147
diff -u -2 -r1.147 msdosfs_vnops.c
--- msdosfs_vnops.c	4 Feb 2004 21:52:53 -0000	1.147
+++ msdosfs_vnops.c	5 Feb 2004 08:11:38 -0000
(Continue reading)


Gmane