Archive for the tag 'Partition'

SBDavid

Mount and Access NTFS Partition

Mount and Access NTFS Partition

NTFS-3G is an open source cross-platform implementation of the Microsoft Windows NTFS file system with read-write support. NTFS-3G often uses the FUSE file system interface, so it can run unmodified on many different operating systems. It is runnable on Linux, FreeBSD, NetBSD, OpenSolaris, and Mac OS X.

yum install ntfs-3g

On Ubuntu / Debian

ubuntu@server3:~$ apt-cache search ntfs-3g
libntfs-3g-dev - ntfs-3g filesystem in userspace (FUSE) library headers
libntfs-3g79 - ntfs-3g filesystem in userspace (FUSE) library
ntfs-3g - read-write NTFS driver for FUSE
ntfs-config - Enable/disable write support for any NTFS devices

Usage

If there was no error during installation then the NTFS volume can be mounted in read-write mode for everybody as follows. Unmount the volume if it had already been mounted, replace /dev/sda1 and /mnt/windows, if needed.

mount -t ntfs-3g /dev/sda1 /mnt/windows

Please see the NTFS-3G Manual for more options and examples.

You can also make NTFS to be mounted during boot by adding the following line to the end of the /etc/fstab file:

/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
SBDavid

Size of swap partition

Size of swap partition

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap.

Creating a large swap space partition can be especially helpful if you plan to upgrade your RAM at a later time.

If your partitioning scheme requires a swap partition that is larger than 2 GB, you should create an additional swap partition. For example, if you need 4 GB of swap, you should create two 2 GB swap partitions. If you have 4 GB of RAM, you should create three 2 GB swap partitions. Red Hat Enterprise Linux supports up to 32 swap files.

mount your /tmp partition with the noexec,nosuid options, and mount the /home partition with the nosuid option.

t install time, the easiest thing to do is to mount your /tmp partition with the noexec,nosuid options, and mount the /home partition with the nosuid option. This is done in your /etc/fstab and requires those paths to exist as partitions, and not just as subdirectories of /. If you’re unsure, type:

mount

To get a listing of your partitions and their current mounting options. Use google for more information on these mounting options. Be very careful when editing your /etc/fstab, as any errors could prevent your system from starting up. Note that you must not have “nosuid,noexec” for / or /usr, as those partitions have suid binaries normally (su, passwd, etc).

Edit the fstab file vi /etc/fstab and change it depending on your needs. For example:

/dev/sda11 /tmp ext2 defaults 1 2
/dev/sda6 /home ext2 defaults 1 2

To read:

/dev/sda11 /tmp ext2 defaults,rw,nosuid,nodev,noexec 1 2
/dev/sda6 /home ext2 defaults,rw,nosuid,nodev 1 2

nosuid, Meaning do not allow set-user-identifier or set-group-identifier bits to take effect, nodev, do not interpret character or block special devices on this file system partition, noexec, do not allow execution of any binaries on the mounted file system.

DirectAdmin simple partition structure

/boot 40 meg
swap 2 x memory
/tmp 1 Gig. Highly recommended to mount /tmp with noexec,nosuid in /etc/fstab
/ 6-10 Gig
/var 8-20 gig. Emails, logs and databases stored here on Redhat/CentOS/Fedora
/usr 5-12 gig. Just DA data, source code, frontpage.
/home rest of drive. Roughly 80% for user data. Mount with nosuid in /etc/fstab if possible.

You may modify these as needed.

Note, if you plan on installing dovecot, all email data is stored under /home and not /var, so adjust as needed. Also FreeBSD and Debian store mysql databases in /home/mysql/.

Please have Basic development/compiling tools such as gcc, g++, and perl.

Securing the /tmp Partition

It is recommended to create /tmp as separate partition and mount it with the noexec and nosuid options.

The noexec option disables the executable file attribute within an entire file system, effectively preventing any files within that file system from being executed.

The nosuid option disables the SUID file-attribute within an entire file system. This prevents SUID attacks on, say, the /tmp file system.

To secure the /tmp partition of your Parallels Plesk Panel server:

If /tmp is a separate partition on the server, you only need to edit /etc/fstab and add the noexec and nosuid options for /tmp. Then remount the partition.

If the /tmp directory resides on the / partition:

Create a new partition for /tmp, for example with size 512 MB:

# mkdir /filesystems
# dd if=/dev/zero of=/filesystems/tmp_fs seek=512 count=512 bs=1M
# mkfs.ext3 /filesystems/tmp_fs
Add the string into /etc/fstab:
/filesystems/tmp_fs /tmp ext3 noexec,nosuid,loop 1 1

Move current /tmp directory content to another location.
Mount new /tmpp partition:
# mount /tmp
Move content from old /tmp directory to the new one.