PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Eine Frage zu quota



Brainman
11.02.08, 17:31
Hallo,
Ich bin gekommen, um mal wieder eine Frage zu stellen:

Zu erst das System:
Isgenug (ovh)
debian 4.0

MySql 5
Apache 2
Php 5
Proftpd

Ich möchte gerne quota in /var/ zum Laufen bringen.

Hier meine /etc/fstab :


# <sys.fichiers><pt de montage><type> <options> <dump> <pass>
/dev/sda1 / ext3 errors=remount-ro 0 1
/dev/sda2 /home ext3 usrquota 1 2
/dev/sda3 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0


Was muss ich jetzt einstellen, bzw remounten, damit ich in /var/ eine quota.user zum Laufen bringen kann?
Wir nennen den Benutzer mal beispielsweise "benutzer1".
Außerdem würde ich gerne die MySql mit begrenzen.
Wäre nett, wenn ihr mir helfen könntet.
Ich hab nämlich keine Ahnung, was ich genau remounten muss, damit ich die user.quota zum Laufen bringen kann.
Dazuzusagen ist:
/dev/sda1 ist die Systempartition
/dev/sda2 ist die allgemein Partition
/dev/sda3 ist der Arbeitsspeicher wenn mich nicht alles irrt.

mfg,
Brainman

edit: Ich habe schon ein userquota in /home/ eingerichtet. Das läuft auch super.

marce
11.02.08, 18:00
Lege für /var eine eigene Partition an, kopiere die vorhandenen Inhalte rein, setze den Mountpunkt in der fstab neu, sicherheitshalber rebooten und richte Quota wie gewünscht ein.

Brainman
11.02.08, 18:03
Lege für /var eine eigene Partition an, kopiere die vorhandenen Inhalte rein, setze den Mountpunkt in der fstab neu, sicherheitshalber rebooten und richte Quota wie gewünscht ein.

Öhm....
Wie richtet man eine neue Partition ein?
Ich habe noch 130GB frei, also ist das kein Problem.
Nächste Frage: Wie setzt man den Mountpunkt neu?
Ich habe mich einmal an der fstab probiert, damit hatte ich mir das System zerschossen.

mfg,
Brainman

marce
11.02.08, 18:23
Öhm....
Wie richtet man eine neue Partition ein?
fdisk + mkfs



Ich habe noch 130GB frei, also ist das kein Problem.
Nächste Frage: Wie setzt man den Mountpunkt neu?
/var in der fstab eintragen



Ich habe mich einmal an der fstab probiert, damit hatte ich mir das System zerschossen.
Fehler sollte man dabei besser keine machen - also besser 3x kontrollieren.

ein Backup vorher schadet auch nicht...

Brainman
11.02.08, 18:29
/var in der fstab eintragen

Wie würde das dann aussehen?

/dev/sda4 /var/ ext3 usrquota 1 2


?

mfg,
Brainman

edit: Ich habe gerade mal fdisk ausprobiert und habe keine Ahnung, wie das funktionieren soll. Eine kurze Anleitung oder ein Link wären extrem nett.
Die partition /dev/sda4 ist die Größte Partition.

Hier mal meine Versuche:

ks36678:~# fdisk

Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
ks36678:~# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 382 3068383+ 83 Linux
/dev/sda2 383 19391 152689792+ 83 Linux
/dev/sda3 19392 19456 522112+ 82 Linux swap / Solaris
ks36678:~# fdisk -u /dev/sda4

Unable to open /dev/sda4
ks36678:~# fdisk -u /dev/sda2
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 19009.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
4
Invalid partition number for type `4'
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 4
First sector (63-305379584, default 63): 100000-305379580
Last sector or +size or +sizeM or +sizeK (100000-305379584, default 305379584): +sizeM 100000
Using default value 305379584

Command (m for help): v
99999 unallocated sectors

Command (m for help): l

0 Empty 1e Hidden W95 FAT1 80 Old Minix be Solaris boot
1 FAT12 24 NEC DOS 81 Minix / old Lin bf Solaris
2 XENIX root 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
5 Extended 41 PPC PReP Boot 85 Linux extended c7 Syrinx
6 FAT16 42 SFS 86 NTFS volume set da Non-FS data
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set db CP/M / CTOS / .
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM df BootIt
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e1 DOS access
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS e4 SpeedStor
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ee EFI GPT
10 OPUS 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f1 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f4 SpeedStor
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fd Linux raid auto
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fe LANstep
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid ff BBT
1c Hidden W95 FAT3 75 PC/IX

Command (m for help): q


mfg

marce
11.02.08, 23:13
fdisk /dev/sda
... und dann halt eine neue Partition anlegen.

Details findest Du in der Man-Page oder auf div. Seiten im Netz...

Wene
11.02.08, 23:32
Auch zu empfehlen ist gparted bzw. die entsprechende Live CD. Damit kannst Du auch vorhandene Partitionen inkl. Dateisystem verkleinern ohne die Daten darin zu verlieren.

marce
11.02.08, 23:34
Auch zu empfehlen ist gparted bzw. die entsprechende Live CD. Damit kannst Du auch vorhandene Partitionen inkl. Dateisystem verkleinern ohne die Daten darin zu verlieren.
Ein gefährlicher Satz - ohne Backup würde ich mich an sowas nie ran machen, jedenfalls wenn die Daten wichtig sind.

Wene
12.02.08, 07:48
Ein gefährlicher Satz - ohne Backup würde ich mich an sowas nie ran machen, jedenfalls wenn die Daten wichtig sind.

100% ACK

Eine vollständige Datensicherung setze ich als selbstverständlich voraus in so einem Fall. :D
Gilt für gparted, fdisk und kommerzielle Produkte wie z.B. Acronis Disk Director gleichermassen. (und für Partition Magic noch ein Bischen mehr ;))