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


Recommended Posts

 

2. Determine drive by ID - Unfortunately "X" above does not help us when it comes time to mount the drive during boot because drive assignment can change.  So instead we are going to identify the drive by its ID using the following comment:

ls /dev/disk/by-id

which will show you something like this

root@Tower:~# ls /dev/disk/by-id

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX@

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX-part1@

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX@

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX-part1@

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX@

ata-Hitachi_HDS5C3020ALA632_ML0220FXXXXXXX-part1@

ata-OCZ-VERTEX2_OCZ-0E6807YCLAXXXXXXX@

ata-OCZ-VERTEX2_OCZ-0E6807YCLAXXXXXXX-part1@

ata-ST2000DL003-9VT166_5YXXXXXXX@

ata-ST2000DL003-9VT166_5YXXXXXXX-part1@

ata-WDC_WD6401AALS-00L3B2_WD-WCASYXXXXXXX@

ata-WDC_WD6401AALS-00L3B2_WD-WCASYXXXXXXX-part1@

...

Again, mine is easy to find since I know it is the only OCZ drive.  If it is not 100% immediately obvious which drive is the right one what should you do? 

 

STOP, think, and post the output to the forum

:)

 

 

 

OK, all of a sudden yesterday, nothing is running on my appdisk.  I had followed your instructions and everything was working for months, but not now.  So I'm going through everything again, and I started with the above step.  Unfortunately, that's where things get a bit weird.  I only have one SSD in my machine, but this is the result I get:

root@Serenity:~# ls /dev/disk/by-id

ata-Samsung_SSD_840_EVO_120GB_S1D5NSADB32164K@

ata-Samsung_SSD_840_EVO_120GB_S1D5NSADB32164K-part1@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0508804@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0508804-part1@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0510364@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0510364-part1@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0510461@

ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0510461-part1@

ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0211550@

ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0211550-part1@

ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0306193@

ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E0306193-part1@

scsi-SATA_Samsung_SSD_840S1D5NSADB32164K@

scsi-SATA_Samsung_SSD_840S1D5NSADB32164K-part1@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0508804@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0508804-part1@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0510364@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0510364-part1@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0510461@

scsi-SATA_WDC_WD30EFRX-68_WD-WMC4N0510461-part1@

scsi-SATA_WDC_WD40EFRX-68_WD-WCC4E0211550@

scsi-SATA_WDC_WD40EFRX-68_WD-WCC4E0211550-part1@

scsi-SATA_WDC_WD40EFRX-68_WD-WCC4E0306193@

scsi-SATA_WDC_WD40EFRX-68_WD-WCC4E0306193-part1@

usb-SanDisk_Cruzer_Fit_4C530005771014123282-0:0@

usb-SanDisk_Cruzer_Fit_4C530005771014123282-0:0-part1@

wwn-0x50014ee058fdb779@

wwn-0x50014ee058fdb779-part1@

wwn-0x50014ee0ae5348c4@

wwn-0x50014ee0ae5348c4-part1@

wwn-0x50014ee0ae534c0a@

wwn-0x50014ee0ae534c0a-part1@

wwn-0x50014ee2091debb5@

wwn-0x50014ee2091debb5-part1@

wwn-0x50014ee2b3c8b05b@

wwn-0x50014ee2b3c8b05b-part1@

wwn-0x50025388a00c1a53@

wwn-0x50025388a00c1a53-part1@

Why is each drive listed as SCSI and as ATA?  Could this be the source of my problem, or is this normal?  I don't remember it looking like this when I first did this.

Link to comment

I see both ATA and SCSI disks on my N54L.  Don't remember any problems using either type RDM'd to VirtualBox VM but I haven't had it setup that way in a while.

 

 

Here is my current list:

ata-ST3000DM001-1CH166_W1F2D8QV@
ata-ST3000DM001-1CH166_W1F2D8QV-part1@
ata-ST4000DM000-1F2168_Z300VVSX@
ata-ST4000DM000-1F2168_Z300VVSX-part1@
ata-ST4000DM000-1F2168_Z300WEMT@
ata-ST4000DM000-1F2168_Z300WEMT-part1@
ata-ST4000DM000-1F2168_Z300WF8K@
ata-ST4000DM000-1F2168_Z300WF8K-part1@
ata-ST4000DM000-1F2168_Z300X9DP@
ata-ST4000DM000-1F2168_Z300X9DP-part1@
ata-ST4000DM000-1F2168_Z300XARC@
ata-ST4000DM000-1F2168_Z300XARC-part1@
ata-WDC_WD3200BEVT-00A23T0_WD-WX21E42N4432@
ata-WDC_WD3200BEVT-00A23T0_WD-WX21E42N4432-part1@
scsi-SATA_ST3000DM001-1CH_W1F2D8QV@
scsi-SATA_ST3000DM001-1CH_W1F2D8QV-part1@
scsi-SATA_ST4000DM000-1F2_Z300VVSX@
scsi-SATA_ST4000DM000-1F2_Z300VVSX-part1@
scsi-SATA_ST4000DM000-1F2_Z300WEMT@
scsi-SATA_ST4000DM000-1F2_Z300WEMT-part1@
scsi-SATA_ST4000DM000-1F2_Z300WF8K@
scsi-SATA_ST4000DM000-1F2_Z300WF8K-part1@
scsi-SATA_ST4000DM000-1F2_Z300X9DP@
scsi-SATA_ST4000DM000-1F2_Z300X9DP-part1@
scsi-SATA_ST4000DM000-1F2_Z300XARC@
scsi-SATA_ST4000DM000-1F2_Z300XARC-part1@
scsi-SATA_WDC_WD3200BEVT-_WD-WX21E42N4432@
scsi-SATA_WDC_WD3200BEVT-_WD-WX21E42N4432-part1@

 

 

In my opinion (probably not worth much) that is normal and nothing to worry about.

Link to comment

hmm ok well that still leaves datruedave without access to your SSD?  Is that true?

 

So we can see the drive listed.

 

There is just no damn good reason for it to change, but you've confirmed the drive-id?

 

And of course a good trouble shooting test is to see if you can manually mount via the console.  It will let you see errors right away that might not show in the logs.

 

Whatever you do though, for now, do not go repartitioning or formatting the drive unless you don't care about the data on it.

Link to comment

Sean did you figure it out?  Sorry I haven't chimed it sooner, but it seems that I'm not getting reliable notifications when people post to this thread.  In any case let us know if you worked out your issue.

 

Little bit of a delayed response on my end, been traveling with work but I still have yet to get the SSD mounted outside the array to be viewable through the windows explorer.  My go script is the same as the one from the install instructions so I'm not 100% sure.  Any advice on how to troubleshoot it?

 

Thanks again!

 

-Sean

Link to comment

hmm ok well that still leaves datruedave without access to your SSD?  Is that true?

 

So we can see the drive listed.

 

There is just no damn good reason for it to change, but you've confirmed the drive-id?

 

And of course a good trouble shooting test is to see if you can manually mount via the console.  It will let you see errors right away that might not show in the logs.

 

Whatever you do though, for now, do not go repartitioning or formatting the drive unless you don't care about the data on it.

 

OK, so here's some more info that might help y'all help me.  I can still access my appdisk from Windows.  But Plex and Sickbeard and Sabnzb are no longer working. 

 

I'm a total newb to linux, so when you say manually mount, that means almost nothing to me.  I was happy when I got everything working by following your instructions to the letter, and I was going to just go through everything (not the formatting part) again to see if I could fix it.  The first time I went through your instructions, it certainly did not list all my drives as both SCSI and ATA, so it startled me to see it listed that way.

Link to comment

hmmm ok i can't put too much thought into this right now.  but the fact that you can access it via windows means it is intact (all data is there right?), mounted, and shared correctly. 

 

Have you upgraded unraid since you first set this up?  Wondering if some new drivers are exposing new features.  Though that wouldn't explain plex and sickbear not seeing it.

 

what are the results of "ls -l /mnt" from the terminal? and assuming the mount point you created is there (like /mnt/appdisk like I used), what are the results of "ls -l /mnt/[your ssd's mount point]" aaaannnddd what did you put in the plex gui?  I am assuming it is something like /mnt/[your ssd mount point]/plex or something like that.  Post a screen shot of the plex gui from unraid settings.

Link to comment

All the data appears to be there.

 

I have not manually upgraded unraid since I first set this up.  Does it upgrade automatically?

 

I have no idea what it means when some things are blue and some are highlighted green:

dfc6pw.png

 

b3t06e.png

 

I'm unable to get the server to not say "Stopped" in unRaid settings.

Link to comment

datruedave, your Plex folder on the appdisk is owned by "root:root" user so unless you are running Plex as root it will not be able to write to that folder.

 

I fixed this issue on my system by chown the entire appdisk and all subfolders to "nobody:users"

 

I'm sorry, but I have no idea how to do that.  And how did this change?  It was working for months, and then it suddenly stopped?  Or is this not the cause of my problems?

Link to comment

From telnet prompt:

chown nobody:users /mnt/appdisk
cd /mnt/appdisk
chown -R nobody:users .

 

I had this issue when I switched from the FrankenPlex 64bit plugin to the Phaze 64bit plugin for Plex.

Plex wouldn't start because of the permissions issue, I did the chown process and it worked fine after that.

 

 

Link to comment

You are changing the ownership group and users that have permission write to the appdisk.

Notice from your output that all of the array disks (cache, disk1, disk2, etc) all are already configured for "nobody users" but your appdisk is configured "root root".

 

The first command changes the ownership of the appdisk to "nobody users".

The second command changes your telnet prompt to the appdisk directory.

The third command changes all folders and subdirectories within the appdisk to "nobody users".

 

The third command may take a couple minutes to complete depending on how many files and directories you have on the appdisk.

Link to comment

I use my cache drive purely for apps.  128gb SSD which is hardly utilized.  I want to start preparing for a dip into the VM pool.

 

If I follow these instructions I assume I will have a drive mounted in my system, outside of th unRAID array, that can still db accessed by my cron jobs for copying, run unRAID plugins and be able to be used as the VM repository and disk allocation ?

 

The only real change would be the /mnt/cache to /mnt/whatevericallit mount name ?

 

That is exactly what I'm doing.  My SSD is mounted in unRaid as /mnt/appdisk. Inside that I have /mnt/appdisk/vm/arch which holds my arch.img, data.img and other associated vm files.  It also had (until I migrated Plex to my archVM) my unraid Plex library folder /mnt/appdisk/plex.  The whole disk is shared by unRaid via samba as "appshare" so remote machines can see it.  That was useful for getting into my plex logs from my PC without having to go into an ssh session to access /mnt/appdisk/plex...

 

I have an unRaid cronjob setup to rsync from /mnt/appdisk/vm/arch to /mnt/user/backup/vm/arch.  You have to do it from unRaid because the VM gets paused to make the copy.

 

Hi, I succesfully mounted my SSD outside the Unraid array in /mnt/VM. I can see it (the VM folder) in windows explorer, but I cannot access it due to a permission error: "You do not have permission to access \\Tower2\vm". I am lost since I am not a linux expert. Pls, can anyone help?

 

This is my smb-extra.conf:

[VM]
     path = /mnt/VM
     browseable = yes
     public = yes
     writeable = yes
     force user = root
     

And my go script:

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#Mount SSD as VM
mkdir /mnt/VM
mount -rw -o noatime,nodiratime,discard -t ext4 /dev/disk/by-id/ata-SanDisk_SDSSDXP120G_132507400152-part1 /mnt/VM

 

Let me know if you need any other info.

 

Link to comment

It may be as easy as running the newperms script against the VM.

 

newperms /mnt/appdisk/VM

 

No luck, still cannot access my VM folder. I seeI get a pop up in windows that says: "Enter Network Password to cZonnect to Tower2" and "user name=P8Z68-PC\root". I don´t understand this since P8Z68-PC is my main pc, and Tower2 is my unraid (running 6b3). I tried entering as password the one i use to connect via putty to my Tower2..no luck. Also tried to enter my main pc password..no luck.

 

Any suggestion?

Link to comment

Hi again, I got it!

The solution was adding just this two lines (wroten by Nezil...thx Nezil).....

I added the following command to my plugin to solve this problem:

[pre]chgrp users /apps

chmod g+w /apps  [/pre]This changes the ownership to root:users, and makes the directory writable for members of the group users. The user that connects to the SMB share is a member of the users group, and is therefore able to write to the root of the share.

...but changing it to my needs:

chgrp users /vm
chmod g+w /vm

Thx all.

 

Link to comment

First off, great tutorial jumperalex!

 

I've actually been using an external 2.5 inch laptop drive connected via USB for my applications for several years now. My unRAID system has 15 3.5" drives, and that's pretty much all I can fit in my case, but there was just enough room behind the motherboard at the bottom of the case for a drive like this. I also figure that it runs cooler and draws less power than a 3.5" drive.

 

In case anyone is interested, my method is subtly different from yours, and some of the changes might be useful to others on the forum. I'll try to talk through each one in turn:

  • I ended up formatting my drive ReiserFS, simply because it was easy and I didn't need TRIM capabilities (this alters the mount command slightly of course).
  • I mounted my drive in /apps in the root of the file system rather than in /mnt. I was worried that some shutdown scripts might try to unmount everything in /mnt, and I wouldn't want that to happen.
  • I named the partition on my external drive 'Applications' and mounted using the /dev/disk/by-label/Applications path rather than the disk ID path, which is slightly more human readable.
  • I chose to create an extremely simple plugin for mounting my drive, and put the plugin in the /boot/plugins folder rather than the conventional /boot/config/plugins location. Plugins in this location are installed before any plugins in the normal location, and some of my plugins reference my /apps drive at installation. The go script is run as the last thing once unRAID is booted after all plugins are installed.
  • My smb-extra.conf file is slightly different. I have set up a single user account that I use for connecting to the unRAID system and browsing shares in normal use. I therefore defined the additional share as browseable and publicly readable, but only writeable for this one user.

My smb-extra.conf looks like this:

[Apps]
        path = /apps
        comment = Installed Applications Disk
        browseable = yes
        # Secure
        public = yes
        writeable = no
        write list = neil

 

The full contents of my Extradrive-noarch-1nr.plg file are as follows:

<PLUGIN>
<!--
2012-04-20 - Neil Robinson: First release

The plugin mounts an additional drive outside of the array, before additional plugins are loaded.
-->

<!-- Install Script -->

<FILE Name="/tmp/extradrive-install" Run="/bin/bash">
<INLINE>
<![CDATA[

if mount | grep -q /apps; then
  echo "Apps drive mounted"
else
  echo "Mounting apps drive..."
  if [ ! -d /apps ]; then
    mkdir /apps
  fi
  mount -o noatime,nodiratime -t reiserfs /dev/disk/by-label/Applications /apps 2>&1
fi

echo "Done."        
  
]]>
</INLINE>
</FILE>

<!-- Plugin-Installed File -->

<FILE Name="/var/log/plugins/extradrive">
<INLINE>
<![CDATA[
The extradrive plugin mounts an additional drive outside of the array, before additional 
plugins are loaded. This is as an alternative to the cache drive.
]]>
</INLINE>
</FILE>
</PLUGIN>

 

Hi, what is the extension for this file (Extradrive-noarch-1nr.plg)? Is it .cfg or .plg?

Rgds.

Link to comment

You are changing the ownership group and users that have permission write to the appdisk.

Notice from your output that all of the array disks (cache, disk1, disk2, etc) all are already configured for "nobody users" but your appdisk is configured "root root".

 

The first command changes the ownership of the appdisk to "nobody users".

The second command changes your telnet prompt to the appdisk directory.

The third command changes all folders and subdirectories within the appdisk to "nobody users".

 

The third command may take a couple minutes to complete depending on how many files and directories you have on the appdisk.

 

Thanks again.  I'm out of town for a few weeks, so won't be able to try it out for a bit.

 

Do you think this will fix my issue if it was working fine before?  I guess something, somewhere must've changed for it not to work, but I just can't imagine what.  I'll definitely try this.

Link to comment
  • 4 weeks later...

alignment check tool http://www.techpowerup.com/articles/other/157

 

some info on the 840 evo http://pastebin.com/0Jvn3PyQ  note they claim the 840 uses 1536k nand erase block sizes and 8 kb page size.

 

EDIT: Note that if that info is correct, then 1024 and 2048 would NOT be the right alignment for a Samsung 840 EVO.  You would need to use 3072

 

This is how I partitioned my Samsung 840 EVO 250G SSD, based on input above. I did not leave any slack space (I don't intend to use up the whole SSD and don't think it matters whether it is unpartitioned or just not used).

 

This replaced the sgdisk command in step 3 in jonp's btrfs post (see HERE).

 

root@Shark:~# gdisk /dev/sdf

GPT fdisk (gdisk) version 0.8.7

 

Partition table scan:

  MBR: not present

  BSD: not present

  APM: not present

  GPT: not present

 

Creating new GPT entries.

 

Command (? for help): p

Disk /dev/sdf: 488397168 sectors, 232.9 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 5DF934B2-48F2-4346-9F6F-BB354543D5F3

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 488397134

Partitions will be aligned on 2048-sector boundaries

Total free space is 488397101 sectors (232.9 GiB)

 

Number  Start (sector)    End (sector)  Size      Code  Name

 

Command (? for help): x

 

Expert command (? for help): L

Enter the sector alignment value (1-65536, default = 2048): 3072

 

Expert command (? for help): m

 

Command (? for help): n

Partition number (1-128, default 1):

First sector (34-488397134, default = 3072) or {+-}size{KMGTP}:

Last sector (3072-488397134, default = 488397134) or {+-}size{KMGTP}:

Current type is 'Linux filesystem'

Hex code or GUID (L to show codes, Enter = 8300):

Changed type of partition to 'Linux filesystem'

 

Command (? for help): p

Disk /dev/sdf: 488397168 sectors, 232.9 GiB

Logical sector size: 512 bytes

Disk identifier (GUID): 5DF934B2-48F2-4346-9F6F-BB354543D5F3

Partition table holds up to 128 entries

First usable sector is 34, last usable sector is 488397134

Partitions will be aligned on 3072-sector boundaries

Total free space is 3038 sectors (1.5 MiB)

 

Number  Start (sector)    End (sector)  Size      Code  Name

  1            3072      488397134  232.9 GiB  8300  Linux filesystem

 

Command (? for help): w

 

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING

PARTITIONS!!

 

Do you want to proceed? (Y/N): Y

OK; writing new GUID partition table (GPT) to /dev/sdf.

The operation has completed successfully.

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.