Can i use tmpfs to mount /tmp ?

2010-09-05 Thread zaxis

cat /etc/fstab 
# DeviceMountpoint  FStype  Options DumpPass#
/dev/ad4s3b noneswapsw  0   0
/dev/ad4s3a /   ufs rw,noatime  1   
1
/dev/ad4s3e /tmpufs rw  2   2
/dev/ad4s3f /usrufs rw  2   2
/dev/ad4s3d /varufs rw  2   2
/dev/acd0   /cdrom  cd9660  ro,noauto   0   0
/dev/ad4s7  /media/Fmsdosfs rw  0   0
/dev/ad4s8  /media/Gext2fs  rw  0   0

The /dev/ad4s3e is used for /tmp. Now i want to use tmpfs instead of ufs as
below
none /tmp tmpfs size=64M,nodev,nosuid,noexec 0 0

If i can, then how to reuse the space of /dev/ad4s3e ?

Sincerely!

-
e^(π⋅i) + 1 = 0
-- 
View this message in context: 
http://old.nabble.com/Can-i-use-tmpfs-to-mount--tmp---tp29625711p29625711.html
Sent from the freebsd-questions mailing list archive at Nabble.com.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Can i use tmpfs to mount /tmp ?

2010-09-05 Thread Matthew Seaman
On 05/09/2010 07:09:50, zaxis wrote:
 The /dev/ad4s3e is used for /tmp. Now i want to use tmpfs instead of ufs as
 below
 none /tmp tmpfs size=64M,nodev,nosuid,noexec 0 0
 
 If i can, then how to reuse the space of /dev/ad4s3e ?

There are two choices.

Either mount your ad4s3e partition somewhere else as a regular
filesystem -- you can move the mount point simply by unmounting it,
editing fstab and then mounting the new partition.  Do that before
mounting your new tmpfs based /tmp, or you'll block access to the whole
filesystem on ad4s3e.  Oh, and 'chmod 755 /new/mountpoint' after you
move it -- you don't want the /tmp defaults of mode 1777 on a normal
filesystem.

Or amalgamate the ad4s3e partition with one of the partitions
neighbouring it on the drive.  Use bsdlabel(8) to examine and modify the
disk-level layout.  If you join ad4s3e on to the end of the preceeding
partition, you can use growfs(8) to expand that partition into the extra
space.  Otherwise you'll have to newfs(8) the expanded partition and
recover the contents from backup.  Either way, this sort of partition
wrangling operation involves low-level fiddling in the guts of the OS
and an enhanced potential for things to go horribly wrong, so make sure
you've got good backups and spend some time planning exactly what you
are going to do, even down to the extent of writing out all the commands
you'll need beforehand.

Cheers,

Matthew

PS.  64MB is pretty small for a /tmp -- you might want to increase the
size of your tmpfs.

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: Can i use tmpfs to mount /tmp ?

2010-09-05 Thread Polytropon
Allow me a short comment regarding your /etc/fstab, not related
to your intial question. You have the following entries:

On Sat, 4 Sep 2010 23:09:50 -0700 (PDT), zaxis z_a...@163.com wrote:
 /dev/ad4s7/media/Fmsdosfs rw  0   0
 /dev/ad4s8/media/Gext2fs  rw  0   0

It looks like you are using the directories F and G in /media to
mount other slices of your hard disk (primary partitions)
corresponding to specific drive letters.

According to man hier, the /media subtree is not intended for
that purpose. Let me quote:

/media/contains subdirectories to be used as mount points for remov-
   able media such as CDs, USB drives, and floppy disks

This directory is often used by automounting solutions such as they
appear in KDE, Gnome or Xfce.

Now, where else would one instead mount them? In /mnt maybe?

/mnt/  empty directory commonly used by system administrators as a
   temporary mount point

No, doesn't seem to look right.

As I didn't have any need to mount FAT/NTFS partitions in my whole
life, I couldn't even suggest some directory where to mount it that
does not interfere with the well-designed and intended concepts of
the FreeBSD file system hierarchy. I had other kinds of partitions
and disks (UFS usually) mounted under /export, but just because they
were then exported via NFS right away, so the use of /export/F and
/export/G would look strange, too (but possible, as FreeBSD does not
have /export per se - it's a Solarism, if I remember correctly).
The same way, you could create any arbitrary name (/winparts, /dos,
/ntmounts or anything else) to not interfere with the expected use
of /media.

Maybe some file system guru cares to join my little sideshow and
explain how it is done correctly? :-)





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Can i use tmpfs to mount /tmp ?

2010-09-05 Thread zaxis

thanks for your suggestion!
df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/ad4s3a496M119M337M26%/
devfs  1.0K1.0K  0B   100%/dev
/dev/ad4s3e496M 18M438M 4%/tmp
/dev/ad4s3f 14G4.8G8.4G37%/usr
/dev/ad4s3d1.4G178M1.1G14%/var
/dev/ad4s7  30G3.6G 26G12%/media/F
/dev/ad4s8  30G4.1G 24G15%/media/G

The /dev/ad4s3e is just 496M. so it is not worth for me to modify the
disk-level layout.


Matthew Seaman-2 wrote:
 
 On 05/09/2010 07:09:50, zaxis wrote:
 The /dev/ad4s3e is used for /tmp. Now i want to use tmpfs instead of ufs
 as
 below
 none /tmp tmpfs size=64M,nodev,nosuid,noexec 0 0
 
 If i can, then how to reuse the space of /dev/ad4s3e ?
 
 There are two choices.
 
 Either mount your ad4s3e partition somewhere else as a regular
 filesystem -- you can move the mount point simply by unmounting it,
 editing fstab and then mounting the new partition.  Do that before
 mounting your new tmpfs based /tmp, or you'll block access to the whole
 filesystem on ad4s3e.  Oh, and 'chmod 755 /new/mountpoint' after you
 move it -- you don't want the /tmp defaults of mode 1777 on a normal
 filesystem.
 
 Or amalgamate the ad4s3e partition with one of the partitions
 neighbouring it on the drive.  Use bsdlabel(8) to examine and modify the
 disk-level layout.  If you join ad4s3e on to the end of the preceeding
 partition, you can use growfs(8) to expand that partition into the extra
 space.  Otherwise you'll have to newfs(8) the expanded partition and
 recover the contents from backup.  Either way, this sort of partition
 wrangling operation involves low-level fiddling in the guts of the OS
 and an enhanced potential for things to go horribly wrong, so make sure
 you've got good backups and spend some time planning exactly what you
 are going to do, even down to the extent of writing out all the commands
 you'll need beforehand.
 
   Cheers,
 
   Matthew
 
 PS.  64MB is pretty small for a /tmp -- you might want to increase the
 size of your tmpfs.
 
 -- 
 Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
   Flat 3
 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
 JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW
 
 
  
 


-
e^(π⋅i) + 1 = 0
-- 
View this message in context: 
http://old.nabble.com/Can-i-use-tmpfs-to-mount--tmp---tp29625711p29627883.html
Sent from the freebsd-questions mailing list archive at Nabble.com.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org