[DEPRECATED] How to partition, format ext4, and mount an SSD outside the array


Recommended Posts

would it be possible to point unmenu's mysql at this disk as well? I'm thinking I want to try this out tonight for plex, but it will involve moving my current array's disk 20 out of the array as that is my SSD. Catch is I also have mysql pointed to disk20. I'd hope/imagine it will just be a matter of updating the "disk label" field in unmenu's package manager. Since this isn't going to be an unraid drive anymore I wasn't sure if it would be as simple as updating it to say appdisk or if it would require a more specific path, or if it just wouldn't work at all and I'll have to look into manually setting up mysql which is a bit more daunting as I'm just learning how to play in linux here.

Link to comment

Yeah I figured as much, but decided it was worth a shot in asking in case someone had already used your steps and started putting other apps like this on the drive. I'll just give it a shot tonight and if it doesn't work start desperately seeking an unmenu/mysql/non array disk knowledgeable person... eep.  Worse case sql will go back on an array protected disk since it isn't as unruly as plex with the constant drive spinning.

Link to comment

I guess I'm just not sure what your question / concern is.

 

Anything that is currently hosted on the array can (should) be able to be housed instead on a non-array drive.  You just have to make sure you set paths correctly.

 

I know when I dabbled with both virtualbox and then xen I was storing my VM's and ISO's on my appdisk and it worked fine.

Link to comment

My question/concern literally was just around the setting of the path correctly. This is pretty much my first time playing with drives like this outside of windows and I'm learning as I go. I went ahead and tried to use appdisk for my path and it did indeed work. Unfortunately now I'm getting random freezes where I can't even type on the command prompt directly on the unraid console. Decided to call it a night for now and let it get through its parity check from removing the SSD since it doesn't seem to lock up if I just let it sit. I've a feeling some config file somewhere is still referencing "disk20" which no longer exist. I'll (hopefully) sort it out this weekend.

Link to comment

so you think you might have a plug-in referencing disk 20?  Seems easy enough to track down, but I don't know how complex your server is.  In any case, good luck and let us know if you run into any sticky wickets.  Anyone checking this thread might have similar concerns even if the final solution is to be found in another topic.

Link to comment

Yeah I hope to sort it out this weekend, but first I want to let it finish its parity check which it should do in about 6 more hours. After sleeping on it I started to wonder if perhaps my SSD doesn't support some of the features used in the mount command (noatime,nodiratime,discard). I'm pretty sure I updated the firmware to support TRIM, but I'll have to double check as this is one of the old original OCZ Vertex drives. I don't know about the other two and if they need any special support for them on the disk itself. It has run fine for about six hours just doing a parity check so that does seem to confirm the issue happens when I try and access this disk (its been happening as I try and reconfigure plex and/or mysql).

 

As it is I think my next course of action is going to be to wipe it, mysql, and plex out entirely and start from scratch with them, but not until unraid is back to happy with its parity. Fortunately my server is not very complicated as I'm just getting into it. This drive and the apps I'm trying to run off it (plex and mysql) are the only thing special. I had it working perfectly hosting my xbmc media and database, but I just had to try and play with plex...

Link to comment

Well other than trim those other "features" are just instructions to the OS telling it to not update the last access times of files and directories.  But in either case, I'm running an OCZ Vertex 2 with those exact parms.

 

As to wiping that drive ... um ... [slaps forehead] ... you pulled this SSD from the array?  So it is still formatted as ReisferFS?  If so that is *A* problem.  RFS doesn't support trim ... as best I was ever able to find at least.  I don't know what happens when you try to mount with discard on an FS that doesn't support it, but at best it is ineffective, at worst it causes actual problems like freezes.

 

Now that said, if your plex library and MySQL db are pretty large, you can easily copy them back to the array (DOH!) format your SSD ext4, then copy them back to avoid having to regenerate.  I know my plex library would take days to recreate because of all the index files.  If you don't have those then I suppose it wouldn't be too bad.

Link to comment

oh no no, I have completely reformatted it using the directions from the beginning of this thread no worries there. A complete rebuild of the database would not be that bad it is just for my xbmc collection with about 300 movies. I've been through so many rebuilds of its database over the years that I now have all my folders named nice to line up with the movie db and I just let it scrape for a bit and everything comes back without a bunch of manual cleanup anymore. As for plex I only had just installed it a couple days ago and hadn't ever really used it when I saw the constant disk spinning and went and found this thread. So nothing to lose there either.

Link to comment

Just for a quick short update. I reformatted and remounted without the discard option and it has been stable for three days running just my xbmc mysql database off of it. I'll try and reinstall plex today and verify it's ok I suspect it will be. I did verify that the drive is running a late enough firmware to support trim. But really the original vertex was kind of terrible yet the only SSD I could afford back in the day so this issue doesn't surprise me. I'll replace this thing eventually.

Link to comment

Thanks a lot for this guide

 

I moved my ubuntu vm to an SSD using this method and it is flying. What a difference it made

 

One quick question, though

 

Normally they say that SSDs do a lot better when they are not full

 

Is that the same when it comes to vm img files?

 

My ubuntu vm is about 70GB. It is on a 120GB SSD. If I move my windows vm that is 40GB onto the same SSD, will it slow down significantly??

 

I heard that it is due to the SSD controller having a hard time finding spots to write new files on. But I am not sure how writes to img files are handled. Since there will only be two files on the SSD and no new files will be created??? I don't know enough to even guess

Link to comment

Generally yes, regardless of how it is being use (i.e. VM) ... but it also varies by SSD based on how much over-provisioning they do.  That is, if they reserve some portion of the actual capacity outside what is accessible to the user.  The more over-provisioned the more cells are available to recover from bad ones, and the more available for things like dealing with garbage collection. 

 

I can't give you a good rule of thumb, but yes I suppose I'd say much more than about 80% full and I'd start looking for a bigger SSD.

 

Right, am image file is nothing special to the SSD.  All it cares about is that some data needs to be written to some cells.  If there are free empty cells great, if not then it has to erase an entire block first, the rewrite it with the data that was already there plus your new data.

Link to comment

Add a "force user = root" to the smb-extra.conf.  This will allow writing to it.  There might be other ways but this suggestion to me by RockDawg is the only one that I've used - it works.

 

Thank You.  Instructions updated.

 

With force user = root, I was not able to access the share over the network.  Windows prompted me for a username/password (root password didn't work) when I tried to access the share.  I removed this line from the file, and I can access and read/write the disk via SMB just fine.  Note I'm using 6.0-beta4.

Link to comment

First I would like to thank jumperalex for his remarkable tutorial.

 

At the end of paragraph  1c, the process is validated by the following command:

root@Tower:/dev/disk/by-id# fsck -N /dev/hd*
fsck from util-linux-ng 2.17.2
[/sbin/fsck.ext2 (1) -- /dev/hde] fsck.ext2 /dev/hde
[/sbin/fsck.reiserfs (2) -- /dev/hde1] fsck.reiserfs /dev/hde1
[/sbin/fsck.ext2 (3) -- /dev/hdf] fsck.ext2 /dev/hdf
[/sbin/fsck.reiserfs (4) -- /dev/hdf1] fsck.reiserfs /dev/hdf1
[/sbin/fsck.ext2 (5) -- /dev/hdg] fsck.ext2 /dev/hdg
[/sbin/fsck.reiserfs (6) -- /dev/hdg1] fsck.reiserfs /dev/hdg1
[/sbin/fsck.ext4 (7) -- /dev/hdh] fsck.ext4 /dev/hdh
[/sbin/fsck.ext4 ( -- /dev/hdh1] fsck.ext4 /dev/hdh1

 

Everything looks normal so far, the SSD being /dev/hdh. But the next step shows the SSD device (first line), but not -part1

 

[quote]root@Tower:/dev/disk/by-id# ls
ata-SSD2SC120G3LC709B121-460I_PNY14130000471460570@
ata-TOSHIBA_DT01ACA200_13E7689AS@
ata-TOSHIBA_DT01ACA200_13E7689AS-part1@
ata-TOSHIBA_DT01ACA200_13EDSNWGS@
ata-TOSHIBA_DT01ACA200_13EDSNWGS-part1@
ata-TOSHIBA_DT01ACA200_23JMGDZAS@
ata-TOSHIBA_DT01ACA200_23JMGDZAS-part1@
ata-TOSHIBA_DT01ACA200_Y2P4X60AS@
ata-TOSHIBA_DT01ACA200_Y2P4X60AS-part1@
ata-TOSHIBA_DT01ACA300_23DES3ZGS@
ata-TOSHIBA_DT01ACA300_23DES55GS@
ata-WDC_WD10EADS-11M2B1_WD-WCAV54129425@
scsi-SATA_TOSHIBA_DT01ACA_13E7689AS@
scsi-SATA_TOSHIBA_DT01ACA_13E7689AS-part1@
scsi-SATA_TOSHIBA_DT01ACA_13EDSNWGS@
scsi-SATA_TOSHIBA_DT01ACA_13EDSNWGS-part1@
scsi-SATA_TOSHIBA_DT01ACA_23JMGDZAS@
scsi-SATA_TOSHIBA_DT01ACA_23JMGDZAS-part1@
scsi-SATA_TOSHIBA_DT01ACA_Y2P4X60AS@
scsi-SATA_TOSHIBA_DT01ACA_Y2P4X60AS-part1@
usb-Corsair_Flash_Voyager_4cb768f2227108-0:0@
usb-Corsair_Flash_Voyager_4cb768f2227108-0:0-part1@
wwn-0x5000039ff3c23b52@
wwn-0x5000039ff3c23b52-part1@
wwn-0x5000039ff3c34620@
wwn-0x5000039ff3c34620-part1@
wwn-0x5000039ff3c5cd52@
wwn-0x5000039ff3c5cd52-part1@
wwn-0x5000039ff3c8d92d@
wwn-0x5000039ff3c8d92d-part1@

 

 

 

Of course, I tried the rest of the tutorial, but the mount cmd shows that the ext4 disk is not present

root@Tower:/dev/disk/by-id# mount
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /var/log type tmpfs (rw,size=128m)
/dev/sda1 on /boot type vfat (rw,noatime,nodiratime,umask=0,shortname=mixed)
/dev/md1 on /mnt/disk1 type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
/dev/md2 on /mnt/disk2 type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
/dev/md3 on /mnt/disk3 type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
/dev/md4 on /mnt/disk4 type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
/dev/md5 on /mnt/disk5 type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
/dev/hdf1 on /mnt/cache type reiserfs (rw,noatime,nodiratime,user_xattr,acl)
shfs on /mnt/user0 type fuse.shfs (rw,nosuid,nodev,noatime,allow_other)
shfs on /mnt/user type fuse.shfs (rw,nosuid,nodev,noatime,allow_other)

 

Where did I go wrong?

ls_by-id.txt

Link to comment

Well shit ... um ... are you sure you did 1b successfully?  i have ot admit despite writing the guide, I'm not a linux guru.  Maybe someone else has seen this?

 

What version of unraid are you using?  I sure hope it isn't something with the new kernel on 6.0.  I'm sure it would be fixable, just annoying.  I wrote this based on what was in 5.x and probably 5.0.1 iirc

Link to comment

First, thank you for not treating me as a moron ;)

 

I am running a very standard UnRAID v5.0.5 on a decent hardware CPU AMD A8-5500 APU on MB Biostar A85W with 8 GB RAM (I know it is not relevant but just to say I am doing it by the book). I am trying to install a brand new PNY 120 GB SSD XR8. I haven't done any firmware modification (yet).

 

Here's what I get after a reboot. The SSD is recognized, even partially /dev/hdh1

 

 

Array Disk Status
Status	Disk	Mounted	Device	Model/Serial	Temp	Reads	Writes	Errors	Size	Used	%Used	Free
OK	parity		/dev/hdg	TOSHIBA_DT01ACA300_23DES3ZGS	39°C	87	32				
OK	/dev/md1	/mnt/disk1	/dev/sdc	TOSHIBA_DT01ACA200_13EDSNWGS	35°C	749	10		2.00T	1.45T	
73%
553.00G
OK	/dev/md2	/mnt/disk2	/dev/hde	TOSHIBA_DT01ACA300_23DES55GS	37°C	6449	10		3.00T	2.25T	
76%
746.17G
OK	/dev/md3	/mnt/disk3	/dev/sde	TOSHIBA_DT01ACA200_13E7689AS	39°C	856	10		2.00T	1.26T	
64%
736.15G
OK	/dev/md4	/mnt/disk4	/dev/sdd	TOSHIBA_DT01ACA200_23JMGDZAS	38°C	1246	9		2.00T	1.20T	
60%
803.19G
OK	/dev/md5	/mnt/disk5	/dev/sdb	TOSHIBA_DT01ACA200_Y2P4X60AS	37°C	984	10		2.00T	1.39T	
70%
613.34G
	 	 	 	 	 	 	 	Total:	11.00T	7.55T	68%	3.45T

UNRAID Drive
Device	Model/Serial	Mounted	File System		Size	Used	%Used	Free
/dev/sda1	usb-Corsair_Flash_Voyager_4cb768f2227108-0:0	/boot			8.07G	235.23M	3%	7.83G
Cache Drive
Device	Model/Serial	Mounted	File System	Temp	Size	Used	%Used	Free
/dev/hdf1		/mnt/cache		34°C	1.00T	8.26G	1%	991.92G
Drive Partitions - Not In Protected Array
Device	Model/Serial	Mounted	File System	Temp	Size	Used	%Used	Free
/dev/hdf	WDC_WD10EADS-11M2B1_WD-WCAV54129425			34°C	1.00T			
/dev/hdh	SSD2SC120G3LC709B121-460I_PNY14130000471460570		
30064771072°C   120.03G			
/dev/hdh1              30064771072°C

 

I must have screwed up somewhere, but frankly I don't see where. I have started over the whole section 1, including erasing the partition before creating a new one. Same result.

Link to comment

PROBLEM SOLVED !!!! ;D ;D

 

Actually, when putting back the motherboard to default safe values, it changed the SATA type and SATA IDE values.

The correct values must be

SATA TYPE  ---> AHCI

SATA IDE combined mode ---> DISABLED

 

All of a sudden the drives hdX became sdX. And everything went back to normal as described in this one-of-its-kind tutorial.

Again, thank you Jumperalex for such a great piece of work!

 

 

 

 

Link to comment

Would this work to add a nonssd outside of the array, and if not could you point me in the correct direction? Thanks

 

Yes you could use this general guide to mount a drive outside the array.  This was written specifically for SSD's to format ext4 allowing for TRIM utilization. 

 

Direct quote from OP:

 

If you found this thread looking for more generic into on how to mount a drive outside the array it should still serve your pupose.  There is no reason not to format as ext4 unless you have a specific reason not to.  However, if you are NOT using an SSD then I would suggest you skip adding discard (aka trim) support.  I don't know if it would actually hurt anything, but it is useless non the less and I don't like doing useless stuff :)  Otherwise the rest of this thread should certainly still be useful and instructive. 

Link to comment

exact same instructions with one option and one subtraction:

 

Subtraction: Do NOT use DISCARD when mounting the drive, that is only for SSDs

Option: you can now use just about any filesystem you want.  The main reason for ext4, beyond being generally good for its purpose, is that it supports DISCARD.  But there is no reason not to use ext4, like I said you now have options

Link to comment

Not sure what the issue was originally but it doesn't appear to be the drive mount script.  However is there any way to view the drive from windows explorer?  I'm not 100% sure if I need to create the directories for NZBGet prior to assigning them and wanted to see the folder structure in the explorer for the appdisk.

 

For example I'm trying to create a NZBGet folder for NZBDrone to drop files into: /mnt/appdisk/nzbget/tv

 

Getting a path does not exist error, not sure if I could view the appdisk in the windows explorer to create these folders?

Link to comment
  • 2 weeks later...

Trying to go through the guide and format an ssd but I'm running into a problem right off the bat.

 

I typed

fdisk -cu /dev/sdb

  sdb is my 500GB ssd.

But I get the following,

root@Tower:~# fdisk -cu /dev/sdb
Usage:
fdisk [options] <disk>    change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition>      give partition size(s) in blocks

Options:
-b <size>             sector size (512, 1024, 2048 or 4096)
-c[=<mode>]           compatible mode: 'dos' or 'nondos' (default)
-h                    print this help text
-u[=<unit>]           display units: 'cylinders' or 'sectors' (default)
-v                    print program version
-C <number>           specify the number of cylinders
-H <number>           specify the number of heads
-S <number>           specify the number of sectors per track

root@Tower:~#

which do not match the options you list in the guide.

 

Checked to see what version of fdisk I'm running, it's

root@Tower:~# fdisk -v
fdisk (util-linux 2.21.2)

 

I also checked to see if the brand new out of the box ssd is formatted and it returned

root@Tower:~# fsck -N /dev/sdb1
fsck from util-linux 2.21.2
[/sbin/fsck.ext2 (1) -- /dev/sdb1] fsck.ext2 /dev/sdb1

 

 

How should I proceed?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.