Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Install]Partizionamento RAID1
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
effeuno
Apprentice
Apprentice


Joined: 23 Dec 2003
Posts: 292

PostPosted: Fri Oct 07, 2005 1:56 pm    Post subject: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Fri Oct 07, 2005 2:03 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
effeuno
Apprentice
Apprentice


Joined: 23 Dec 2003
Posts: 292

PostPosted: Fri Oct 07, 2005 2:07 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Fri Oct 07, 2005 4:35 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4795
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Oct 07, 2005 7:07 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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. :D
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4795
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Oct 07, 2005 7:18 pm    Post subject: Reply with quote

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.


:D :D :D
_________________
vu vu vu
gentù
mi piaci tu
Back to top
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Fri Oct 07, 2005 7:23 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4795
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Fri Oct 07, 2005 7:38 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Fri Oct 07, 2005 9:25 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

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
View user's profile Send private message
cloc3
Advocate
Advocate


Joined: 13 Jan 2004
Posts: 4795
Location: http://www.gentoo-users.org/user/cloc3/

PostPosted: Sat Oct 08, 2005 7:33 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

@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. :oops: 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
View user's profile Send private message
.:chrome:.
Advocate
Advocate


Joined: 19 Feb 2005
Posts: 4588
Location: Brescia, Italy

PostPosted: Sat Oct 08, 2005 9:19 pm    Post subject: Re: [Install]Partizionamento RAID1 Reply with quote

cioè...? vorresti fare un disco virtuale, e poi partizionarlo pure?
spero di avere capito male... perché è davvero una gran sega mentale :D
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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum