View previous topic :: View next topic |
Author |
Message |
effeuno Apprentice
Joined: 23 Dec 2003 Posts: 292
|
Posted: Fri Oct 07, 2005 1:56 pm Post subject: [Install]Partizionamento RAID1 |
|
|
Avendo a disposizione 2 dischi sata da 80GB voglio fare un RAID1 software per il mio server.
Domanda: se io partiziono soltanto 40GB per esempio con
/boot (md0)
swap (md1)
/ (md2)
/usr (md3)
/var (md4)
/tmp (md5)
posso poi, una volta che ho capito come utilizzarlo, partizionare i restanti 40GB posizionandoli su altri md...???
Grazie per eventuali suggerimenti. |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Fri Oct 07, 2005 2:03 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
certamente che puoi. perché no?
io metterei in RAID anche lo swap. supponiamo che si schianti un disco. se è proprio quello dello swap, inevitabilmente finirebbe col tirarsi dietro tutto il sistema.
in ogni caso io farei in modo diverso:
creati dei piccoli dischi virtuali:
Code: | dd if=/dev/zero of=file1 bs=... count=... |
e crea il RAID su quelli. fai tutti gli esperimenti del caso, e poi installa direttamente la configurazione definitiva. meglio così che mettere nuovamente mano al sistema in seguito, no? |
|
Back to top |
|
|
effeuno Apprentice
Joined: 23 Dec 2003 Posts: 292
|
Posted: Fri Oct 07, 2005 2:07 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
k.gothmog wrote: |
in ogni caso io farei in modo diverso:
creati dei piccoli dischi virtuali:
Code: | dd if=/dev/zero of=file1 bs=... count=... |
e crea il RAID su quelli. fai tutti gli esperimenti del caso, e poi installa direttamente la configurazione definitiva. meglio così che mettere nuovamente mano al sistema in seguito, no? |
Non capisco cosa intendi??????
Mi spieghi meglio la procedura ed il senso di "disco virtuale"???? |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Fri Oct 07, 2005 4:35 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
nei sistemi UNIX tutto viene visto come file, compresi dischi e directory.
fare il mount di un disco vero o di un file system che sta in realtà dentro un file è la stessa cosa.
visto che devi fare degli esperimenti credo sia meglio farli su dei dischi virtuali, non trovi?
per creare un disco virtuale:
Code: | # creo un file di 1024 blocchi di 1024 byte (quindi di 1 MB) fatto di tutti zeri
dd if=/dev/zero of=~/file bs=1024 count=1024
# formatto
mkfs.ext2 ~/file
# faccio il mount
mkdir /mnt/test
mount -o loop ~/flle /mnt/test |
|
|
Back to top |
|
|
cloc3 Advocate
Joined: 13 Jan 2004 Posts: 4810 Location: http://www.gentoo-users.org/user/cloc3/
|
Posted: Fri Oct 07, 2005 7:07 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
k.gothmog wrote: |
fare il mount di un disco vero o di un file system che sta in realtà dentro un file è la stessa cosa.
|
Stai dicendo che nel file virtuale potresti inserire anche una vera e propria tabella delle partizioni?
Non ci avevo mai pensato.
Anzi. Adesso provo. _________________ vu vu vu
gentù
mi piaci tu |
|
Back to top |
|
|
cloc3 Advocate
Joined: 13 Jan 2004 Posts: 4810 Location: http://www.gentoo-users.org/user/cloc3/
|
Posted: Fri Oct 07, 2005 7:18 pm Post subject: |
|
|
Affascinante: tutto da semplice utente:
Code: |
cloc3@s939 ~ $ dd if=/dev/zero of=~/file bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
cloc3@s939 ~ $ /sbin/fdisk file
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.
You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): x
Expert command (m for help): c
Number of cylinders (1-1048576): 1024
Expert command (m for help): r
Command (m for help): o
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.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1024, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1024, default 1024):
Using default value 1024
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 25: Inappropriate ioctl for device.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
|
_________________ vu vu vu
gentù
mi piaci tu |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Fri Oct 07, 2005 7:23 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
Code: | morgoth ~ # whoami
root
morgoth ~ # dd if=/dev/zero of=~/file
310193+0 records in
310192+0 records out
morgoth ~ # dd if=/dev/zero of=~/file bs=1024 count=102400
102400+0 records in
102400+0 records out
morgoth ~ # mkfs.ext2 file
mke2fs 1.38 (30-Jun-2005)
file is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
morgoth ~ # mkdir test
morgoth ~ # mount -o loop file test/
morgoth ~ # df -ah
Filesystem Size Used Avail Use% Mounted on
/dev/hda5 9.6G 8.0G 1.7G 83% /
proc 0 0 0 - /proc
sysfs 0 0 0 - /sys
udev 236M 0 236M 0% /dev
devpts 0 0 0 - /dev/pts
/dev/hda2 130M 11M 113M 9% /boot
/dev/hda7 26G 19G 6.4G 75% /home
none 236M 0 236M 0% /dev/shm
usbfs 0 0 0 - /proc/bus/usb
/root/file 97M 13K 92M 1% /root/test
morgoth ~ # cp /etc/fstab test/
morgoth ~ # find test/
test/
test/lost+found
test/fstab
morgoth ~ # umount test/
morgoth ~ # mount -o loop file test/
morgoth ~ # find test/
test/
test/lost+found
test/fstab
morgoth ~ # |
|
|
Back to top |
|
|
cloc3 Advocate
Joined: 13 Jan 2004 Posts: 4810 Location: http://www.gentoo-users.org/user/cloc3/
|
Posted: Fri Oct 07, 2005 7:38 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
k.gothmog wrote: | [code]morgoth ~ # whoami
root
etc.
|
Certamente. Ma questo lo sapevo. Tu, mi hai fatto pensare al fatto delle partizioni, che mi suona maledettamente più intrigante . _________________ vu vu vu
gentù
mi piaci tu |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Fri Oct 07, 2005 9:25 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
cloc3 wrote: | Certamente. Ma questo lo sapevo. Tu, mi hai fatto pensare al fatto delle partizioni, che mi suona maledettamente più intrigante . |
non ho capito |
|
Back to top |
|
|
cloc3 Advocate
Joined: 13 Jan 2004 Posts: 4810 Location: http://www.gentoo-users.org/user/cloc3/
|
Posted: Sat Oct 08, 2005 7:33 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
@mods: temo di essere andato un po' OT dal tema della discussione, e me ne scuso anche con effeuno. Se lo credete, splittate pure la parte inessenziale.
k.gothmog wrote: |
non ho capito |
mmHm. Probabilmente sono io a non capire...
Il fatto è che avevo fatto i conti senza l'oste. Dopo aver partizionato correttamente il file, è possibile associarlo a un dispositivo di loop con losetup (da root):
Code: |
losetup /dev/loop0 file
|
ma non sono ancora riuscito a montare e formattare le partizioni che contiene, perché non ho trovato un modo di associarle ad un dispositivo autonomo, come avviene con i normali dischi, che appaiono nella forma /dev/hda, /dev/hda1, ..., /dev/hdan .
Può darsi che la cosa non sia particolarmente utile, ma mi sembrerebbe comunque istruttiva e divertente. _________________ vu vu vu
gentù
mi piaci tu |
|
Back to top |
|
|
.:chrome:. Advocate
Joined: 19 Feb 2005 Posts: 4588 Location: Brescia, Italy
|
Posted: Sat Oct 08, 2005 9:19 pm Post subject: Re: [Install]Partizionamento RAID1 |
|
|
cioè...? vorresti fare un disco virtuale, e poi partizionarlo pure?
spero di avere capito male... perché è davvero una gran sega mentale
a che ti serve, scusa? è così comodo avere i dischi virtuali uno per file: li estendi e li stringi come vuoi. se partizioni pure non puoi più fare questo disccorso |
|
Back to top |
|
|
|