Page 1 of 1

FoxyRoxy HotSwap Drives

PostPosted: Sun Oct 21, 2012 5:30 am
by jbv
FoxyRoxyLinux now supports hot-swapping USB and SATA hard drives.
Drives are are mounted in /media by the Partition Label.
All SATA and USB drives attached to the machine are also mounted at power-up.

If a device without a partition label is inserted, the volume partition ID is used.

In other words:

If you insert a drive with a single partition that does not have a label and the drive would traditionally be mounted as /dev/sdb1 then the drive will be mounted as /media/sdb1

If you insert a drive with a single partition that has a label of MYDISK it will be mounted as [/b]/media/MYDISK[/b]

Drives are automatically unmounted when removed.
If a drive with multiple partitions is removed, then all of the mounted partitions are unmounted.

There are a few areas that could do with some tweaking, which will be done in time.

At the moment, the system checks to see if the partition is mounted (using the mount point it intends to use) and if it is, it will not mount the drive/partition. This could have implications if two drives have the same label, whereby the second drive/partition probably will not be mounted.

There was a slight conflict with the previous USB auto-mount, and as a consequence, the injection for the new AutoMount removed the old auto-mount from 02-FoxyDesktop.squashfs when you run the injection. The accompanying injection also turns the power off on your machine, instead of just doing a "reboot" as previous injections have done. The reason for this is as follows:

Sorting this out also revealed another minor problem. The original .sqfs have a file /etc/mtab which should not be in the filesystem during boot as it can mess with the way the machine maps USB sticks if you have hard-drives attached. Therefore, the injection that accompanies this sqf removes this file from both 01-FoxyRoxy and 02-FoxyDesktop

To install this feature, you should download the attachment below into your /live directory and restart your machine. While you can test some of the functionality, automatic un-mounting of drives may leave the mount directory in /media and the first partition or HDD may not be automatically mounted after a warm-boot (restart). The unmount issue is due to the new auto-mount fighting with the old auto-mount. The warm-boot is due to a conflict with the /etc/mtab file which is in 01-FoxyRoxy

injecting this package into FoxyRoxyLinux will rectify these issues.
The injection will require about 500Mb of disk space on your boot drive.
It is suggested that you delete any old .sqfback files before the injection.

This package also includes ntfs-3g and all NTFS volumes are mounted with full r/w access.

To inject this into FoxyRoxy, simply type 10-inject from a command-prompt.

Over the next few days I will develop some scripts to flush, dismount, and spin-down SATA drives, so they can be safely removed from a hot-swap bay.

Cheers, Brenton

Re: FoxyRoxy HotSwap Drives

PostPosted: Tue Oct 30, 2012 9:17 pm
by KazzaMozz
Hi Brenton,
Over the next few days I will develop some scripts to flush, dismount, and spin-down SATA drives, so they can be safely removed from a hot-swap bay.

This will be cool :)
I'm so tempted to unbox my NAS.....................just to play with this :lol:

Re: FoxyRoxy HotSwap Drives

PostPosted: Wed Oct 31, 2012 6:46 am
by KazzaMozz
Hi Brenton
re the PM I just remembered the stick I had was saved to use mount-all flip will redo a new stick along with all the other adds I had on it.
Been a while since she was booted.
It has an internal bay with the USB stick I had previously setup (see this is what happens when you unpack stuff up and quickly load it up)
So will reload redo :lol:

Re: FoxyRoxy HotSwap Drives

PostPosted: Wed Oct 31, 2012 7:07 am
by jbv
Hi Kazza,

Safer to just "inject" it which will also remove /etc/mtab

Leaving /etc/mtab there won't hurt anything, but it can mess with stuff when you've got multiple volumes and you will definitely get strange stuff when "restarting" if mtab is there. Strange as in drives will appear with different /dev/sdX designators

The Automount stuff will still mount everything in the same place inside /media though, as it uses the partition label.

I'm going to (try to) spend this weekend playing with partitioning and formatting under Linux (which I've got to refresh myself on) and then spend a little time on disk pooling (which is already working manually). Then I may clean up the HotSwap stuff so that it doesn't use mount (I will read /proc/mounts which will be more accurate) and I will also put in some more error checking to make sure we handle stuff like having two or more partitions with the same label a little nicer.

It is already very solid from the testing I have done.
It just needs the "standard" FoxyRoxyLinux "spit-and-polish" to be ready for "prime-time" :)

Oh, I've already has our Snapshot RAID running (much earlier in the year), so while there are still a few things to do, there are no show-stoppers that I'm aware of. Pretty much everything was "sanity" checked earlier in the year.

Cheers, Brenton

Re: FoxyRoxy HotSwap Drives

PostPosted: Sun Nov 04, 2012 12:48 am
by KazzaMozz
Hi Brenton
so I have my mini NAS here with me. My plan will be if time permits.
Do a fresh install of FoxyRoxy,
Backup the drives (this might take too long)
Check the Microsever supports XFS if it does Format the 4 drives using that. Otherwise it may have to be EXT3 or 4. Might be a new bios available!
Setup as a RAID snapshot system :D Go back and refresh about this!
Add my extras to Foxy related to the HP microserver and add-in cards, (oh if I could find that sata card it would be good packed I think down here somewhere) to add the extra drive I'm sure that's here somewhere too for the snapshot drive.
Take some pics of the progress along the way. (they might come in handy for later)
Fantastic work Brenton :ugeek:

Re: FoxyRoxy HotSwap Drives

PostPosted: Sat Sep 07, 2013 9:06 am
by jbv
Just a brief note to everyone using this ... Over the last few days I have been really beating up on this stuff.

The basics are really very solid and they work very well. During the testing, I have been using a mix of Hard Drives with various partition tables and a mix of filesystems. There is one issue that keeps on jumping up and biting me though. The issue is when there is white-space is in a Volume Label, as in "This Volume". Linux really doesn't handle white-space in file-names very well, and it likes it even less in Volume Labels.

If you have any issues with auto-mounting of any volume, be it a HDD or USB drive, then open Gparted and check the Volume Label. If it has white-space in the Volume Label, then rename the Volume Label so there is no white-space and your problems will vanish.