Information on Linux filesystem
- File system
- Basic idea: a drive is
partitioned : think layers:
- Filesystem layer : / /home
/tmpSpace
- Partition layer : /dev/sda1 /dev/sda1
/dev/sdb1
- Physical layer: hard disk 1
(sda) hard disk 2 (sdb)
- Organization of the
file tree on Ubuntu
- Types:
- Overview
- df -T to see what your system is using
- File types:
- Issue a 'ls -lt' and you will see all files listed...two
examples
- drwxrwxr-x. 2 jjm jjm
4096 Apr 20 21:01 tmp
- -rw-rw-r--. 1 jjm jjm 86112
Apr 20 17:16 resultsEXP1.tar.gz
- 10 characters.....the first identifies the file type:
- d (directory)
- -(regular file)
- c or b (character or block device file)
- s (domain socket)
- p (named pipe)
- l (symbolic link) : create 'ln
-s'.
- Next 9 bits identies the permissions (rwx) for the user, the
group, the world
- Bits with octal values 4000 and 2000 are the setuid and
getuid bits. Users have their UID and GUID set in the
login configuration. When a user runs a program with the
UID or GID set differently, the user runs the program using
the higher privilege.
- The uid is set if we see an 's' in the
listing: 'ls -lt /usr/bin/passwd'
- -rwsr-xr-x. 1 root root 27012 Aug 21 2010
/usr/bin/passwd
- To remove >chmod -s /file
- To add >chmod u+s /file
- File Permissions
- Tools/commands
- See previous discussion on data recovery
- df -k : report disk usage
- df -T : show the filesystem type
- du -k : report du space
- fsck - to fix a corrupted disk
- fdisk- to partition a disk
- mount - mounts a file system (issue a 'df -k' to
see current mount points)
- RAID: redundant arrays of inexpensive disks
- Overview
- RAID 0 : Boosts server performance by 'striping' access
requests across >1 drives But no error protection....use RAID 1 or RAID 5 instead!
- RAID 1: Disk mirroring (add a second drive)
- RAID 5: Better Mirroring option than RAID 1, provides correction with parity (best to use 3 drives)
- Use Ubuntu server ISO if you want RAID....everything is installed
- Build your own RAID with 2 drives: