NSLU2-Linux
view · edit · print · history

HowTo.CorrectBadSharingWithTwoDrives History

Hide minor edits - Show changes to markup

September 11, 2013, at 06:05 AM by Pan -- Instructions for Unslung 6.8
Changed lines 124-125 from:
to:

Pan - Unslung 6.8

I boiled this down to a single addition of the lines:

umount /share/flash/conf
mount /share/flash/conf

to /etc/rc.d/rc.bootbin just above the "return 0"

March 02, 2010, at 03:34 AM by SRS -- for 3 or more NON Native go here
Changed lines 122-129 from:

Maybe Unslung 6.12 could add PostDiversion? scripts that get called at the end of the rc.d scripts in addition to the current Diversion scripts that get called at the start of the rc.d scripts ;-)

to:

Maybe Unslung 6.12 could add PostDiversion? scripts that get called at the end of the rc.d scripts in addition to the current Diversion scripts that get called at the start of the rc.d scripts ;-)

NOTE:

You might also want to take a look at http://www.nslu2-linux.org/wiki/HowTo/3orMoreEXT3DrivesWithAUSBHub. SRS 03/01/2010

January 30, 2009, at 05:21 PM by Lurch -- My improvements to the existing method
Changed lines 95-122 from:

Alain.

to:

Alain.


Lurch's update: (this is all on Unslung 6.10)

Although Alain doesn't explicitly mention it, his apporach above is much better than UseSharesOnTwoNativeDisksInUnslung68 - it seems to properly fix the 'bad mounts' people are asking about, and as a result the web GUI works perfectly for adding and deleting shares on both disks, and there's no "nnnn~1" shares anywhere.

I've found that all Alain's /etc/my_mount script needs to contain is:

#!/bin/sh
umount /share/flash/conf
mount /share/flash/conf
return 1

which has a kind of beautiful simplicity to it :) (The reason it works is that umount dismounts it from the 'wrong' partition, and mount then reads /etc/fstab which is correct, and so it gets mounted with the correct partition)

It seems like the thing that's doing the 'wrong mount' (I'm making educated guesses) is the binary file /sbin/rc.bootbin which gets called by /etc/rc.d/rc.bootbin which in turn is called by /etc/rc.d/rc.1 So we can't make use of the DiversionScripts because we need to call '. /etc/my_mount' as soon as possible after /sbin/rc.bootbin (and there's no suitable diversion script in /etc/rc.d/rc.1 between /etc/rc.d/rc.bootbin and the /.ext3flash checks.

So IMHO the best place to add

. /etc/my_mount

is in /etc/rc.d/rc.bootbin just above the "return 0"

Maybe Unslung 6.12 could add PostDiversion? scripts that get called at the end of the rc.d scripts in addition to the current Diversion scripts that get called at the start of the rc.d scripts ;-)

May 18, 2008, at 10:20 AM by maisondouf --
Changed lines 14-15 from:

I have found the begining of an answer here : http://www.nslu2-linux.org/wiki/HowTo/UseSharesOnTwoNativeDisksInUnslung68

to:

I have found the begining of an answer here : HowTo.UseSharesOnTwoNativeDisksInUnslung68

May 12, 2008, at 09:54 PM by maisondouf --
Changed lines 60-62 from:
  1. umount: forced umount of /dev/sdb2 failed!
  2. umount: cannot umount /dev/sdb2: Invalid argument
to:
May 12, 2008, at 09:42 PM by maisondouf --
Changed line 95 from:

So just before '/share/hdd/conf/share.info' and '/share/flash/conf/share.info' will be concatened into '/share/hdd/conf/samba/share.info', the mounting points are OK...

to:

So just before '/share/hdd/conf/share.info' and '/share/flash/conf/share.info' are concatened into '/share/hdd/conf/samba/share.info', the mounting points will be OK...

May 12, 2008, at 09:40 PM by maisondouf --
Changed lines 81-82 from:

Last minute : I've found the good place to include my script ! ! !

to:

Last minute : I've found the good place to include my script ! ! !

May 12, 2008, at 09:39 PM by maisondouf --
Changed lines 81-84 from:

Last minute : I've found th good place to include my script ! ! !

It's in /etc/rc.d/rc.1 just before this line

to:

Last minute : I've found the good place to include my script ! ! !

It's in '/etc/rc.d/rc.1' just before this line

May 12, 2008, at 09:38 PM by maisondouf --
Changed lines 79-97 from:

Alain

to:

Alain

Last minute : I've found th good place to include my script ! ! !

It's in /etc/rc.d/rc.1 just before this line

/bin/echo  "Restore usrgrpshares:"; /etc/rc.d/rc.reset_usrgrpshare; check_status

You put only this :

. /etc/my_mount

So just before '/share/hdd/conf/share.info' and '/share/flash/conf/share.info' will be concatened into '/share/hdd/conf/samba/share.info', the mounting points are OK...

Alain.

May 12, 2008, at 09:30 PM by maisondouf --
Added line 73:

return 1

May 08, 2008, at 08:51 PM by maisondouf -- CorrectBadSharingWithTwoDrives
Changed lines 14-15 from:

I have found the begin of an answer here : http://www.nslu2-linux.org/wiki/HowTo/UseSharesOnTwoNativeDisksInUnslung68

to:

I have found the begining of an answer here : http://www.nslu2-linux.org/wiki/HowTo/UseSharesOnTwoNativeDisksInUnslung68

May 08, 2008, at 08:19 PM by maisondouf -- CorrectBadSharingWithTwoDrives
Changed lines 12-13 from:

The result of that is to have duplicated share with '~1' at the end for disk1 and no more shares for disk2...

to:

The result of that is to have duplicated shares with '~1' at the end for disk1 and no more shares for disk2...

May 08, 2008, at 08:17 PM by maisondouf -- CorrectBadSharingWithTwoDrives
Changed lines 1-2 from:

Due to problems when two native formated drives are connected to the nslu2, I try to understand along the forums and the HowTo, how my slug can have this curious behaviour when rebooting.

to:

Due to problems when two native formated drives are connected to the nslu2, I have tried to understand along the forums and the HowTo, how my slug can have this curious behaviour when rebooting.

Changed line 5 from:

1- the 'conf' partition of the first disk on USB1? is mounted two times :

to:

1- the 'conf' partition of the first disk on USB 1 is mounted two times :

Changed lines 18-19 from:

So, I try to create a little script to dismount and remount the 'conf' partitions in the good place.

to:

So, I have tried to create a little script to dismount and remount the 'conf' partitions in the good place.

May 08, 2008, at 08:15 PM by maisondouf --
Added lines 22-24:

[@

Changed lines 73-75 from:
to:

@]

May 08, 2008, at 08:08 PM by maisondouf -- CorrectBadSharingWithTwoDrives
Added lines 1-73:

Due to problems when two native formated drives are connected to the nslu2, I try to understand along the forums and the HowTo, how my slug can have this curious behaviour when rebooting.

In fact, two problems are distinct :

1- the 'conf' partition of the first disk on USB1? is mounted two times :

   /dev/sdb2 on /share/hdd/conf
   /dev/sdb2 on /share/flash/conf

2- the samba server, due to the first problem, find two times the same file 'share.info' in the two mounted directories.

The result of that is to have duplicated share with '~1' at the end for disk1 and no more shares for disk2...

I have found the begin of an answer here : http://www.nslu2-linux.org/wiki/HowTo/UseSharesOnTwoNativeDisksInUnslung68

But the mis-mounted partitions are already there and the risk to forget updating the backup file is important.

So, I try to create a little script to dismount and remount the 'conf' partitions in the good place.

I have wrote this and it make exactly what I want it make, but I do'nt know really where I have to put it to be executed at startup before samba begin to run.

  1. ! /bin/sh
  2. Essai de rebricolage automatique des partitions mal montées
  3. try to automaticly repair mis-mounted partitions
  4. mount result after boot
  5. /dev/root on /initrd type jffs2 (rw)
  6. /dev/sdb1 on / type ext3 (rw)
  7. proc on /proc type proc (rw)
  8. usbdevfs on /proc/bus/usb type usbdevfs (rw)
  9. /dev/sda1 on /share/flash/data type ext3 (rw)
  10. /dev/sdb1 on /share/hdd/data type ext3 (rw)
  11. /dev/sdb2 on /share/hdd/conf type ext3 (rw,sync) ] 2 times the same partition -> sharing errors
  12. /dev/sdb2 on /share/flash/conf type ext3 (rw,sync) ] 2 fois la même partition -> erreurs de partage
  13. d'abord demonter tout à la barbare
  14. first all unmounting like Mc GYVER

umount -f /dev/sdb2 umount -f /dev/sdb2

  1. puis remonter ce que l'on a besoin et dans l'ordre
  2. and remount only what we need and in the good order

mount -t ext3 /dev/sda2 /share/flash/conf mount -t ext3 /dev/sdb2 /share/hdd/conf

  1. résultat après lancement de /etc/my_mount
  2. result after running /etc/my_mount
    1. /etc/my_mount
  3. umount: forced umount of /dev/sdb2 failed!
  4. umount: cannot umount /dev/sdb2: Invalid argument
  5. umount: forced umount of /dev/sdb2 failed!
  6. umount: cannot umount /dev/sdb2: Invalid argument
    1. mount
  7. /dev/root on /initrd type jffs2 (rw)
  8. /dev/sdb1 on / type ext3 (rw)
  9. proc on /proc type proc (rw)
  10. usbdevfs on /proc/bus/usb type usbdevfs (rw)
  11. /dev/sda1 on /share/flash/data type ext3 (rw)
  12. /dev/sdb1 on /share/hdd/data type ext3 (rw)
  13. /dev/sda2 on /share/flash/conf type ext3 (rw) } each partition have its own mounting point
  14. /dev/sdb2 on /share/hdd/conf type ext3 (rw) } chaque partition a son propre point de montage

If a nslu2-linux senior can spend some of his time to implement this in the startup of unslung, this will be wonderfull for everybody...

Alain

view · edit · print · history · Last edited by Pan.
Based on work by SRS, Lurch, and maisondouf.
Originally by maisondouf.
Page last modified on September 11, 2013, at 06:05 AM