Discussion:
How to share paging file between NetBsd and Windows 7?
Ottavio Caruso
2014-04-04 10:14:17 UTC
Permalink
On 4 April 2014 12:08, Ottavio Caruso wrote:

> 2) Create a ext2 partition, create a pagefile on it and mount it on both OS's


Correction. it should be :Create a msdos partition, not ext2

So the options are:

1) Install fuse-ntfs-3g and mount the existing Windows page file on Netbsd
2) Create a msdos partition, create a pagefile on it and mount it on both OS's
3) NetBsd should have its own swap partition
4) Other ideas

Sorry for the noise.

--
Ottavio
Ottavio Caruso
2014-04-04 10:08:19 UTC
Permalink
Hello,

which of these options is the most recommended to share a paging file
between Windows 7 and Netbsd:

1) Install fuse-ntfs-3g and mount the existing Windows page file on Netbsd
2) Create a ext2 partition, create a pagefile on it and mount it on both OS's
3) NetBsd should have its own swap partition
4) Other ideas

Thanks

--
Ottavio
Benny Siegert
2014-04-04 19:06:46 UTC
Permalink
On Fri, Apr 4, 2014 at 12:14 PM, Ottavio Caruso
<ottavio2006-***@yahoo.com> wrote:
> 1) Install fuse-ntfs-3g and mount the existing Windows page file on Netbsd

That's a definite No, I would say. The NTFS-3G driver is probably not
stable enough, and you may run into all kinds of random problems.

> 2) Create a msdos partition, create a pagefile on it and mount it on both OS's

Not sure if Windows likes that.

> 3) NetBsd should have its own swap partition

This is definitely the best solution. Disk space is not that expensive
any more, just use a few gigs for each. Swap partitions are definitely
the preferred way of doing swap space.

--Benny.
Christos Zoulas
2014-04-04 21:17:29 UTC
Permalink
In article <CAN+FjHNaKxUqE=uWrut1w540Xr1iEs+***@mail.gmail.com>,
Benny Siegert <***@gmail.com> wrote:
>On Fri, Apr 4, 2014 at 12:14 PM, Ottavio Caruso
><ottavio2006-***@yahoo.com> wrote:
>> 1) Install fuse-ntfs-3g and mount the existing Windows page file on Netbsd
>
>That's a definite No, I would say. The NTFS-3G driver is probably not
>stable enough, and you may run into all kinds of random problems.

Yes, but you can mount_ntfs locally readwrite, and point the swap file to
the windows pagefile. I believe that should work because the write code for
NTFS is complete but the block allocation and freeing code is missing, but
you don't need that.

christos
Ottavio Caruso
2014-04-05 08:24:10 UTC
Permalink
On 4 April 2014 23:17, Christos Zoulas <***@astron.com> wrote:
> you can mount_ntfs locally readwrite, and point the swap file to
> the windows pagefile. I believe that should work because the write code for
> NTFS is complete but the block allocation and freeing code is missing, but
> you don't need that

I tried but it didn't work. I couldn't chmod the pagefile to 600:

-bash-4.2# chmod 600 /mnt/pagefile.sys
chmod: /mnt/pagefile.sys: Operation not supported

On 4 April 2014 21:06, Benny Siegert <***@gmail.com> wrote:
>> 2) Create a msdos partition, create a pagefile on it and mount it on both OS's
>
> Not sure if Windows likes that.

I took that from a quite old Linux-howto. I think Windows 7 should
accept that. Would it be enough for Netbsd? Would Netbsd allow me to
change permission on a ms-dos mounted file?

>> 3) NetBsd should have its own swap partition
>
> This is definitely the best solution. Disk space is not that expensive
> any more, just use a few gigs for each.


My old Thinkpad has 80G, of which more than 60 taken by Windows. I can
remove something but any Gig saved is welcome.




Ottavio
Christos Zoulas
2014-04-05 14:01:26 UTC
Permalink
On Apr 5, 10:24am, ottavio2006-***@yahoo.com (Ottavio Caruso) wrote:
-- Subject: Re: How to share paging file between NetBsd and Windows 7?

| On 4 April 2014 23:17, Christos Zoulas <***@astron.com> wrote:
| > you can mount_ntfs locally readwrite, and point the swap file to
| > the windows pagefile. I believe that should work because the write code for
| > NTFS is complete but the block allocation and freeing code is missing, but
| > you don't need that
|
| I tried but it didn't work. I couldn't chmod the pagefile to 600:
|
| -bash-4.2# chmod 600 /mnt/pagefile.sys
| chmod: /mnt/pagefile.sys: Operation not supported

Yes, chmod is not supported on NTFS. It is also not really meaningful
with the NTFS semantics (would be emulated by removing the read write
and execute from all the other entity ACLs from the file, but that's
different again).

| I took that from a quite old Linux-howto. I think Windows 7 should
| accept that. Would it be enough for Netbsd? Would Netbsd allow me to
| change permission on a ms-dos mounted file?

There are no permissions on msdos.

| My old Thinkpad has 80G, of which more than 60 taken by Windows. I can
| remove something but any Gig saved is welcome.

christos
Ottavio Caruso
2014-04-05 15:52:13 UTC
Permalink
On 5 April 2014 16:01, Christos Zoulas <***@zoulas.com> wrote:
> Yes, chmod is not supported on NTFS. It is also not really meaningful
> with the NTFS semantics (would be emulated by removing the read write
> and execute from all the other entity ACLs from the file, but that's
> different again).

So I have now installed fuse-ntfs-3g, mounted the win partition rw
with uid=0, then:

-bash-4.2# swapctl -a /mnt/win7/pagefile.sys
swapctl: WARNING: /mnt/win7/pagefile.sys is readable by the world
swapctl: WARNING: /mnt/win7/pagefile.sys is writable by the world

Still complaining, however:

-bash-4.2# swapctl -s
total: 2054448 blocks allocated = 0 blocks used, 2054448 blocks available

and:

-bash-4.2# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 2028154880 731725824 1296429056 0 154378240 584462336
Swap: 2103754752 0 2103754752
MemTotal: 1980620 kB
MemFree: 1266044 kB
MemShared: 0 kB
Buffers: 150760 kB
Cached: 570764 kB
SwapTotal: 2054448 kB
SwapFree: 2054448 kB

Does it mean the swap file is actually working?


--
Ottavio
Christos Zoulas
2014-04-05 17:58:22 UTC
Permalink
On Apr 5, 5:52pm, ottavio2006-***@yahoo.com (Ottavio Caruso) wrote:
-- Subject: Re: How to share paging file between NetBsd and Windows 7?

| So I have now installed fuse-ntfs-3g, mounted the win partition rw
| with uid=0, then:
|
| -bash-4.2# swapctl -a /mnt/win7/pagefile.sys
| swapctl: WARNING: /mnt/win7/pagefile.sys is readable by the world
| swapctl: WARNING: /mnt/win7/pagefile.sys is writable by the world
|
| Still complaining, however:
|
| -bash-4.2# swapctl -s
| total: 2054448 blocks allocated = 0 blocks used, 2054448 blocks available
|
| and:
|
| -bash-4.2# cat /proc/meminfo
| total: used: free: shared: buffers: cached:
| Mem: 2028154880 731725824 1296429056 0 154378240 584462336
| Swap: 2103754752 0 2103754752
| MemTotal: 1980620 kB
| MemFree: 1266044 kB
| MemShared: 0 kB
| Buffers: 150760 kB
| Cached: 570764 kB
| SwapTotal: 2054448 kB
| SwapFree: 2054448 kB
|
| Does it mean the swap file is actually working?

Yes, but it is not used since there is a lot of memory left.

christos
Ottavio Caruso
2014-04-05 21:20:12 UTC
Permalink
On 5 April 2014 19:58, Christos Zoulas <***@zoulas.com> wrote:
> On Apr 5, 5:52pm, ottavio2006-***@yahoo.com (Ottavio Caruso)
> | Does it mean the swap file is actually working?
>
> Yes, but it is not used since there is a lot of memory left.
>
> christos

I was eventually able to add the win partition and the paging file to
/etc/fstab:

#Added win7 partition
/dev/wd0f /mnt/win7 ntfs-3g rw 0 0
#Added win7 swap file
/mnt/win7/pagefile.sys none swap sw,priority=1 0 0

However I had to make a soft link from /usr/pkg/bin/mount.ntfs-3g to
/sbin/mount_ntfs-3g to make it work.


--
Ottavio
David Lord
2014-04-05 18:17:32 UTC
Permalink
On 5 Apr 2014 at 17:52, Ottavio Caruso wrote:

> On 5 April 2014 16:01, Christos Zoulas <***@zoulas.com> wrote:
> > Yes, chmod is not supported on NTFS. It is also not really meaningful
> > with the NTFS semantics (would be emulated by removing the read write
> > and execute from all the other entity ACLs from the file, but that's
> > different again).
>
> So I have now installed fuse-ntfs-3g, mounted the win partition rw
> with uid=0, then:
>
> -bash-4.2# swapctl -a /mnt/win7/pagefile.sys
> swapctl: WARNING: /mnt/win7/pagefile.sys is readable by the world
> swapctl: WARNING: /mnt/win7/pagefile.sys is writable by the world
>
> Still complaining, however:
>
> -bash-4.2# swapctl -s
> total: 2054448 blocks allocated = 0 blocks used, 2054448 blocks available
>
> and:
>
> -bash-4.2# cat /proc/meminfo
> total: used: free: shared: buffers: cached:
> Mem: 2028154880 731725824 1296429056 0 154378240 584462336
> Swap: 2103754752 0 2103754752
> MemTotal: 1980620 kB
> MemFree: 1266044 kB
> MemShared: 0 kB
> Buffers: 150760 kB
> Cached: 570764 kB
> SwapTotal: 2054448 kB
> SwapFree: 2054448 kB
>
> Does it mean the swap file is actually working?

You have enough free memory so it's not swapping.

>From my system just now:
105M Act, 8072K wired, 15M Exec, 68M File, 2844M Free
Swap: 1372M Total, 1372M Free

Last week I had too many sysbuild jobs which had my system
almost unusable before sysbuild crashed. I've now split
sysbuild jobs into four sets to run without swapping on
different days.


David


> --
> Ottavio
Brett Lymn
2014-04-07 05:47:42 UTC
Permalink
On Sat, Apr 05, 2014 at 10:01:26AM -0400, Christos Zoulas wrote:
> |
> | -bash-4.2# chmod 600 /mnt/pagefile.sys
> | chmod: /mnt/pagefile.sys: Operation not supported
>
> Yes, chmod is not supported on NTFS. It is also not really meaningful
> with the NTFS semantics (would be emulated by removing the read write
> and execute from all the other entity ACLs from the file, but that's
> different again).
>

Not really applicable here but for win 2008 server and later the unix
permissions get encoded into special sids:

http://technet.microsoft.com/en-us/library/hh509017(v=ws.10).aspx

more for NFS access but the ACLs are there to see from the windows
management tools.

--
Brett Lymn
Staple Guns: because duct tape doesn't make that KerCHUNK sound - xkcd.com
Christos Zoulas
2014-04-07 15:15:41 UTC
Permalink
In article <***@internode.on.net>,
Brett Lymn <***@internode.on.net> wrote:
>On Sat, Apr 05, 2014 at 10:01:26AM -0400, Christos Zoulas wrote:
>> |
>> | -bash-4.2# chmod 600 /mnt/pagefile.sys
>> | chmod: /mnt/pagefile.sys: Operation not supported
>>
>> Yes, chmod is not supported on NTFS. It is also not really meaningful
>> with the NTFS semantics (would be emulated by removing the read write
>> and execute from all the other entity ACLs from the file, but that's
>> different again).
>>
>
>Not really applicable here but for win 2008 server and later the unix
>permissions get encoded into special sids:
>
>http://technet.microsoft.com/en-us/library/hh509017(v=ws.10).aspx
>
>more for NFS access but the ACLs are there to see from the windows
>management tools.

True; for that to work we'd have to adjust our ntfs code to pay
attention at those sids. Still the additional ACL's should be
modified so that the system does not think that the file is world
readable or writable.

christos
Loading...