pmount with multiple partitions

Asked by Dirk

Besides my daily backups I wanted to create a complete mirror disk for my laptop. The idea was to use dd to create the mirror and then weekly rsync to keep it updated. Here is what I did:

Step 1:
main disk installed in laptop, three partitions: hda1 is swap, hda2 is ext3 mounted on /, and hda3 is ext3 mounted on /d
mirror disk (same model and size as main disk) installed in USB box
dd if=/dev/hda of=/dev/sda

Step 2:
mirror disk installed in laptop, boot, verify that everything looks as if I'm using the main disk. This was ok. Then create labels:
tune2fs -L mirror_hda2 /dev/hda2
tune2fs -L mirror_hda3 /dev/hda3

Step 3:
main disk installed in laptop, connect mirror disk in USB box.
As expected, I find sda, sda1, sda2 and sda3 in /dev.
But I find only mirror_hda2 in /media. This is correctly mounted from /dev/sda2. There is also an entry about this in /etc/mtab. I would expect to also see /media/mirror_hda3, but it's not there although I can manually pmount it.

The strange thing is that Nautilus shows me two icons on the desktop: mirror_hda2 and mirror_hda3. The first one works as expected on the USB disk, but the second one points to /d which is is on /dev/hda3, i.e. the main disk, not the mirror in the USB box.

How can I convince Nautilus to correctly mount both partitions when I connect the USB drive? (I also have a USB disk with three NTFS partitions. When I connect that one, all partitions shows up correctly, so I guess it must be something particular with the mirror disk.)

Side question: whenever I connect a USB drive with n partitions, n Nautilus windows will pop up. Is it possible to switch that off? Automounting the USB partitions is fine, but I don't need all these Nautili.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Dirk
Solved:
Last query:
Last reply:
Revision history for this message
Dirk (rptq) said :
#1

One clarification:
When I manually mount /dev/sda3 to /media/mirror_hda3, then everything is fine. The mirror_hda3 icon in Nautilus that accesses /dev/hda3 is displayed as soon as I plug in the USB, i.e. before I do a manual mount.

Revision history for this message
Best Dirk (rptq) said :
#2

The problem was that dd on the device level is too good a copy. The UUIDs on the mirror disk were identical to the UUIDs on the main disk. Since my /etc/fstab recognizes partitions by their UUID, things got confused when suddenly there were two partitions with the same UUID.

I changed the UUID on the mirror disk with "tune2fs -U random" and the problem was solved. Now I just need to make sure that /etc/fstab and /boot/grub/menu.lst are excluded from the rsync because they are specific to the disk.