New IT forum
11 August 2022, 06:32:23 pm *
Welcome, %1$s. Please login or register.

: MiraBox now in stock.
 
Pages: [1]

Author Topic: Auto-mount eSata at boot  (Read 9827 times)

cog

  • Newbie
  • *
  • Posts: 7
Auto-mount eSata at boot
« on: 28 November 2010, 11:56:25 am »

Hi all

My setup is a SheevaPlug eSata with the default Jaunty OS installed (I used the recovery process to get it back after doing what a lot of people do - attempted to upgrade to Lucid!).

I want to run the device as it is with an eSata drive attached for audio storage.  I'm going to install Twonky Server on the Sheeva having had a lot of success with this setup on an unslung NSLU2.

I want to mount the drive to /mnt/esata.

I can do this from the terminal OK, and I've also mounted some remote samba shares from the Sheeva terminal and copied files about, all OK.

The plug won't come back after a restart command from the terminal - I'll connect to the serial port later and see what the issue is but the question is:

With a default install, no SD card and a 1Tb eSata drive, what's the best procedure to follow to mount the drive (and what's the best filesystem to use), format it, and have it auto-mount at boot?

Also, if I use an SD card to install the OS (the only thing I'd be likely to do is install Debian on it) - what are the benefits?  Does the plug run better in some way from an SD card as the OS drive?

Thanks!
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Auto-mount eSata at boot
« Reply #1 on: 28 November 2010, 01:14:11 pm »


With a default install, no SD card and a 1Tb eSata drive, what's the best procedure to follow to mount the drive (and what's the best filesystem to use), format it, and have it auto-mount at boot?

Here's what I have in my /etc/fstab:

Code: [Select]
LABEL=newit-data  /mnt/newit-data  ext3  user  0  0

This means that ahard drive with label "newit-data" is automatically mounted at /mnt/newit-data. It's ext3 formatted, which is probably the most natural choice. Use fdisk and mkfs.ext3 to prepare / partition & format the drive. (eg mkfs.ext3 -L my-data /dev/sda1 would format the partition that is on /dev/sda1 and the label would be "my-data").

Alternatively, you can specify the drive by UUID in fstab instead of by label, or simply by device. Here's an example for auto-mounting of a FAT formatted USB partition in /dev/sda1

Code: [Select]
/dev/sda1  /mnt/USB  vfat  user  0  0

Also, if I use an SD card to install the OS (the only thing I'd be likely to do is install Debian on it) - what are the benefits?  Does the plug run better in some way from an SD card as the OS drive?

There are 2 advantages to booting from SD card; firstly you aren't wearing the NAND drive, which does have a limited lifetime. Secondly, it makes it very easy to backup and swap SD cards around, so that you could (for instance) have one SD card with your media server system, and another for a development system.
Logged

cog

  • Newbie
  • *
  • Posts: 7
Re: Auto-mount eSata at boot
« Reply #2 on: 28 November 2010, 03:13:15 pm »

That's great advice, thank you.

The reason the plug wouldn't boot is that I'd left an SD card in, so it probably isn't blank and might contain an OS that won't boot - quite likely!

I'll try those instructions for mounting the eSata drive automatically.

Another question - if I do fdisk -l  , I get 3 devices.

/dev/sda1
/dev/sda2
/dev/sda3

sda2 and 3 only have a small amount of blocks.

I'm guessing sda represents the drive, and the 1,2 & 3 are parts of it, with 2 and 3 being some sort of specialist areas?

Thanks again
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Auto-mount eSata at boot
« Reply #3 on: 28 November 2010, 03:58:56 pm »

The 3 "parts" are 3 partitions. You can mount each separately. As to why there are 3 partitions - who knows fdisk -l should give useful information (partition types). If there's nothing on the drive that you need, you can delete all 3 existing partitions and format the whole drive as one new partition.
Logged

cog

  • Newbie
  • *
  • Posts: 7
Re: Auto-mount eSata at boot
« Reply #4 on: 28 November 2010, 08:23:59 pm »

Thanks again.

fdisk -l lists 3 partitions, then.

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcbce2081

Device Boot      Start          End            Blocks           Id  System
/dev/sda1          1                121571      976519026   83  Linux
/dev/sda2          121572      121586      120487+      83  Linux
/dev/sda3          121587      121601      120487+      82  Linux swap / Solaris

It's off topic but I'm interested as to why a straightforward ext3 format of this drive appeared to create two partitions!  Two of them are minuscule compared with sda1.  It's not being booted from.

Can I just delete sda2 and sda3 then?

I do really appreciate your help.  Every dealing with NewIT I've had has been excellent - this sort of support sets you apart, well done.

Thanks
Logged

NewIT_Marcus

  • Hero Member
  • *****
  • Posts: 960
Re: Auto-mount eSata at boot
« Reply #5 on: 28 November 2010, 10:15:17 pm »

If you don't want to use the swap space at the end of your hard drive, you can repartition and reformat. I'm sure I can't explain how it got into that state in the first place; but a default O/S install (on different hardware) might have done so.

Some people do use swap space on the Sheevaplug; we haven't encountered any situation where it is required.
Logged

cog

  • Newbie
  • *
  • Posts: 7
Re: Auto-mount eSata at boot
« Reply #6 on: 30 November 2010, 08:04:03 am »

Thanks again!
Logged
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!