[gull] [Q] monter une "sous-partition"?

sneaky56 at gmx.net sneaky56 at gmx.net
Sun Jul 19 18:26:43 CEST 2009


> Datum: Sat, 18 Jul 2009 21:06:41 +0200
> Von: sneaky56 at gmx.net

> > Datum: Sat, 18 Jul 2009 10:52:49 +0200
> > Von: "Félix Hauri" <felix at f-hauri.ch>
> 
> > Quelque chose comme:
> > !!! ATTENTION !!! Comme d'hab, je décline toutes responsabilité sur
> > les conséquence de l'application plus ou moins fidèle de ce qui suit!
> > # mount -o loop,ro,offset=$((63*255*512*63)) -t ext3 /dev/sdb5
> > /pointdemontage
> > 
> > Si cela ne se passe pas bien, renvoie nous la sortie de
> > # dmesg | tail
> 
> Merci. Vu que c'était au boulot et que là je suis en vacances,
> j'essaierai à mon retour, cependant, si j'ai le temps, j'essaierai d'abord à la
> maison et vous tiendrai au courant.

Voilà, je viens de faire un test (cette fois-ci c'est sda7 qui nous intéresse):

# fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500106780160 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000f2304

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          31      248976   83  Linux
/dev/sda2              32        1004     7815622+  82  Linux swap / Solaris
/dev/sda3            1005       27751   214845277+   5  Extended
/dev/sda5            1005        3436    19535008+  83  Linux
/dev/sda6            3437       21673   146488671   83  Linux
/dev/sda7           21674       27751    48821503+  83  Linux

# fdisk -l /dev/sda7
Disk /dev/sda7: 50.0 GB, 49993219584 bytes
255 heads, 63 sectors/track, 6077 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005726f

     Device Boot      Start         End      Blocks   Id  System
/dev/sda7p1               1         122      979933+  82  Linux swap / Solaris
/dev/sda7p2             123        6077    47833537+  83  Linux

En essayant la formule de Félix, j'obtiens une erreur:
# mount -o loop,ro,offset=$((123*8225280)) -t ext2 /dev/sda7 /mnt/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Cependant, en modifiant légèrement, ça fonctionne (122*... au lieu de 123*...):
# mount -o loop,ro,offset=$((122*8225280)) -t ext2 /dev/sda7 /mnt/
# ls -al /mnt/
total 96
drwxr-xr-x 21 root root  4096 2009-07-19 16:50 .
drwxr-xr-x 23 root root  4096 2009-04-13 21:18 ..
drwxr-xr-x  2 root root  4096 2009-07-19 17:34 bin
drwxr-xr-x  3 root root  4096 2009-07-19 17:34 boot
lrwxrwxrwx  1 root root    11 2009-07-19 16:46 cdrom -> media/cdrom
drwxr-xr-x  4 root root  4096 2009-07-19 16:48 dev
drwxr-xr-x 48 root root  4096 2009-07-19 17:38 etc
drwxr-xr-x  3 root root  4096 2009-07-19 17:34 home
lrwxrwxrwx  1 root root    28 2009-07-19 16:50 initrd.img -> boot/initrd.img-2.6.26-2-486
drwxr-xr-x 12 root root  4096 2009-07-19 16:51 lib
drwx------  2 root root 16384 2009-07-19 16:46 lost+found
drwxr-xr-x  3 root root  4096 2009-07-19 16:46 media
drwxr-xr-x  2 root root  4096 2009-04-24 21:21 mnt
drwxr-xr-x  2 root root  4096 2009-07-19 16:47 opt
drwxr-xr-x  2 root root  4096 2009-04-24 21:21 proc
drwxr-xr-x  4 root root  4096 2009-07-19 17:38 root
drwxr-xr-x  2 root root  4096 2009-07-19 17:34 sbin
drwxr-xr-x  2 root root  4096 2009-06-24 21:53 selinux
drwxr-xr-x  2 root root  4096 2009-07-19 16:47 srv
drwxr-xr-x  2 root root  4096 2009-06-29 22:22 sys
drwxrwxrwt  2 root root  4096 2009-07-19 17:36 tmp
drwxr-xr-x 10 root root  4096 2009-07-19 16:47 usr
drwxr-xr-x 13 root root  4096 2009-07-19 16:47 var
lrwxrwxrwx  1 root root    25 2009-07-19 16:50 vmlinuz -> boot/vmlinuz-2.6.26-2-486

C'est clair, vu que la première partition démarre avec le cylindre 1 qui a un offset de 0.

> Je pense que je ne risque pas trop tant que je monte en read-only.
> Faudrait éventuellement, pour être tout à fait du bon côté en ce qui concerne
> mes données, de monter le tout en ext2 et non en ext3.

Il me semble avoir lu une fois que même si on monte une partition ext3 en ro, elle rejoue le journal, alors que si elle est montée en ext2, ce n'est pas le cas. Malheureusement, je n'arrive plus à retrouver l'info... (il se peut que je me mélange les pinçaux...).

Ceci dit, je ne connaisais pas l'option "offset" et je ne savais pas qu'une partition doit commencer avec un cylindre (sauf la première).

Merci et bon après-midi


tom
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the gull mailing list