Koozali.org: home of the SME Server

how to attach usb drive

TaNk

how to attach usb drive
« on: August 31, 2006, 08:49:02 AM »
hey gang,

            here's my setup.

Standlone file server only
30gb hd runing sme

and now i just added 300gb usb maxtor drive. i ssh into the box and config the usb hd now it show's if i run the command df -k

[root@server /]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root
                      28866684   2273996  25126320   9% /
/dev/md1                101018     18750     77052  20% /boot
none                    126988         0    126988   0% /dev/shm
/dev/sda1            245051840        32 245051808   1% /mnt/usbdrive

but now my qes is.

1) how can i save stuff to this drive, since it dosn't show up in gui. i tryed to save some big file and it still save's in /dev/md1.

2)every time i boot usbhd is gone i have to mount it again, is it possible to edit a config where it mount it self on boot.

please help a n00bie

Thanks alot
TaNk

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
how to attach usb drive
« Reply #1 on: August 31, 2006, 10:19:04 AM »
SME 7 is configured to auto mount USB drive when you plug it or when you reboot the SME to :
/media/usbdisk
then  if there's more than one partition on it or if you plug a second one
/media/usbdisk1
etc.


TH eway you can do is to do a symling in your ibay folder and create a folder with good right on you usb disk.

Another way would be to modify the script which auto mount or using udev to mount one usb disk (thanks to it's serial number to a different location like an ibay)

Thanks to developpers to tell us what is the script which is in charge of mount this drive.

I am actually searching for it to try theses modifications.

TaNk

how to attach usb drive
« Reply #2 on: August 31, 2006, 08:29:02 PM »
thanks for reply "unnilennium"

but when i make ibay account it still save's stuff in my / folder.

also when i reboot it dosn't mount usbdisk in /media

thanks

TaNk

how to attach usb drive
« Reply #3 on: August 31, 2006, 09:46:18 PM »
ok now i got it to mount on reboot but still when i connect a network drive thro xp and share my \\server\usbdisk folder and save some stuff it still goes to my / folder.

i did make and ibay account and put it in as usbdisk just like it say's in /media/usbdisk

thanks

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
how to attach usb drive
« Reply #4 on: August 31, 2006, 09:54:35 PM »
didi you make an entry in fstab to mount /media/"usbdisk" to /home/e-smith/files/ibays/"myibay"/files

that's what i suggested

TaNk

how to attach usb drive
« Reply #5 on: August 31, 2006, 10:00:34 PM »
thnx for quick reply again. im a pure n00b @ linux  :hammer:  just in learning process can you please tell me how can i make the entry.

ie:- if you can give me the commands.

Thanks alot

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com

TaNk

how to attach usb drive
« Reply #7 on: September 01, 2006, 10:25:13 PM »
Quote from: "unnilennium"
http://no.longer.valid/phpwiki/index.php/extra%20hard%20disk


Hey unnilennium,

i tired that guide but when i get to step 6. i get few errors.

[root@server /]# mkdir /mnt/bigdisk
[root@server /]# pico /etc/fstab
[root@server /]# mount -a
[root@server /]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root
              ext3    28866684   1306724  26093592   5% /
/dev/md1      ext3      101018     25203     70599  27% /boot
none         tmpfs      127584         0    127584   0% /dev/shm
/dev/sda1     ext3      247035      6176    228104   3% /mnt/bigdisk
[root@server /]# mkdir -p /mnt/bigdisk/ibays/mp3
[root@server /]#
[root@server /]# ls -l /home/e-smith/files/ibays
total 4
drwxr-xr-x  5 root root 4096 Aug 31 23:25 Primary
[root@server /]# chown admin:allstaff /mnt/bigdisk/ibays/mp3
chown: admin:allstaff': invalid group

please tell me if im doing somthing wrong.

Thanks

Offline Jean-Philippe Pialasse

  • *
  • 2,774
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
how to attach usb drive
« Reply #8 on: September 02, 2006, 12:08:16 AM »
admin:allstaff was an example change it to the owner and group defined  to th eibay via the server manager.
 or you can check whose owner is for the folder thanks to midnight commender (mc)

JP

Offline judgej

  • *
  • 375
  • +0/-0
how to attach usb drive
« Reply #9 on: September 02, 2006, 07:14:17 PM »
Quote from: "unnilennium"
didi you make an entry in fstab to mount /media/"usbdisk" to /home/e-smith/files/ibays/"myibay"/files

that's what i suggested


So what happens when fstab gets recreated by fstab-sync? Should the changes not be made in some templates somewhere in the HAL sub-system?

-- JJ
-- Jason

Offline byte

  • *
  • 2,183
  • +2/-0
how to attach usb drive
« Reply #10 on: September 02, 2006, 07:41:37 PM »
Quote from: "judgej"
Quote from: "unnilennium"
didi you make an entry in fstab to mount /media/"usbdisk" to /home/e-smith/files/ibays/"myibay"/files

that's what i suggested


So what happens when fstab gets recreated by fstab-sync? Should the changes not be made in some templates somewhere in the HAL sub-system?

-- JJ


You can edit the fstab directly, thats the only rare file that doesn't need to be templated.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline judgej

  • *
  • 375
  • +0/-0
how to attach usb drive
« Reply #11 on: September 03, 2006, 12:50:14 AM »
Quote from: "byte"
You can edit the fstab directly, thats the only rare file that doesn't need to be templated.


That's surprising to hear. The file I have, has warnings in it about fstab-sync overwriting it. I had the impression that the HAL daemon ran all the time, and updated fstabs whenever it detected a relevant change in the hardware. Or perhaps the HAL daemon is disabled in SME Server?

Updated: I see now that the entries added by fstab-sync have the option 'managed' on them. Without that option, they will not get touched by the fstab-sync.

I use entries such as this to auto-mount a disk with the label 'backup2' to the 'backup2' mount point:

LABEL=backup2 /media/backup2 ext3 auto,user,owner,pamconsole 0 0

It is handy being able to direct specific external disks to specific mount points like this. The same can be done using the serial number of the disks, but the labels are a bit easier to manage (i.e. I can apply the label to any other disk to have it mounted from there, but it is a bit more difficult to move serial numbers from one disk to another).

-- JJ
-- Jason

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
how to attach usb drive
« Reply #12 on: October 31, 2006, 12:57:40 PM »
I need some major help with this.

I've split a smeserver raid, taken the removed drive and placed a usb to ide adapter on it and plugged into another smeserver using a degraded raid array (single drive).

I wish to copy a few things that were once in the /home directory of the original smeserver.

The drive appears as sda1 and sda2.
Code: [Select]
Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   fd  Linux raid autodetect
/dev/sda2              14       36481   292929210   fd  Linux raid autodetect


I mounted /dev/sda1 fine and can see grub and the kernel images etc.

When I attempt to mount /dev/sda2 I get errors.
Code: [Select]
[root@c3 /]# mount -t ext3 /dev/sda2 /hd
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       or too many mounted file systems
[root@c3 /]#

Same command just changing /dev/sda1 to /dev/sda2 . I unmounted /dev/sda1 between attempts.

What am I doing wrong? Is it because the partion type is FD even though it did work for the first partition?

I also had the same results on a suse 10.1 laptop.
Regards,
William

IF I give advise.. It's only if it was me....

Offline Gaston94

  • ****
  • 184
  • +0/-0
how to attach usb drive
« Reply #13 on: November 01, 2006, 03:11:39 PM »
Hi William,
the issue you encounter is just because you forgot your are dealing with a LVM2 based system. You have to address the correct structure ;)
(the /dev/sda1 == /boot partition is not under lvm that's why you where able to access)

You need to have an LVM2 capable system to access your data (most of the linux distribution and latest liveCD are now OK with that).

cross check you can see the partition and activate the partition
Code: [Select]
[root@centos ~]# pvscan
  PV /dev/md2    VG main         lvm2 [1.88 GB / 32.00 MB free]
  PV /dev/sda2   VG VolGroup00   lvm2 [1.69 GB / 0    free]
  PV /dev/sdc1   VG VolGroup00   lvm2 [992.00 MB / 0    free]
  Total: 3 [4.53 GB] / in use: 3 [4.53 GB] / in no VG: 0 [0   ]
[root@centos ~]# vgchange -ay main
  2 logical volume(s) in volume group "main" now active
[root@centos ~]# mount /dev/main/root /mnt/
[root@centos ~]# cat /mnt/etc/redhat-release
CentOS release 4.3 (Final) - SME Server 7.0
it's done ;)

I have not been able, so far, to access one sme7 disk on another sme7, I guess the reason is linked to metadevice used (/dev/md2) : when I plugged one foreign disk it hides my other disk :cry: should any one have some clues .. :) let me know.

Gaston

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
how to attach usb drive
« Reply #14 on: November 02, 2006, 07:57:47 AM »
Quote from: "Gaston94"
Hi William,
the issue you encounter is just because you forgot your are dealing with a LVM2 based system. You have to address the correct structure ;)
(the /dev/sda1 == /boot partition is not under lvm that's why you where able to access)

You need to have an LVM2 capable system to access your data (most of the linux distribution and latest liveCD are now OK with that).

cross check you can see the partition and activate the partition
Code: [Select]
[root@centos ~]# pvscan
  PV /dev/md2    VG main         lvm2 [1.88 GB / 32.00 MB free]
  PV /dev/sda2   VG VolGroup00   lvm2 [1.69 GB / 0    free]
  PV /dev/sdc1   VG VolGroup00   lvm2 [992.00 MB / 0    free]
  Total: 3 [4.53 GB] / in use: 3 [4.53 GB] / in no VG: 0 [0   ]
[root@centos ~]# vgchange -ay main
  2 logical volume(s) in volume group "main" now active
[root@centos ~]# mount /dev/main/root /mnt/
[root@centos ~]# cat /mnt/etc/redhat-release
CentOS release 4.3 (Final) - SME Server 7.0
it's done ;)

Gaston


Thank you.
Regards,
William

IF I give advise.. It's only if it was me....