Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 May 2013, 19:12
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to mount USB hd at startup?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
DavidBell

Joined: 24 Nov 2006
Posts: 132

PostPosted: Fri 01 Feb 2008, 21:45    Post subject:  How to mount USB hd at startup?  

I have a usb hard drive (fat32 I'm pretty sure) that I want to mount at start up.

mount /dev/sda1 /mnt/sda1

works from terminal but has two problems, first is the filenames are all the eight letter form instead long names, and it doesn't seem to work from rc.local. I'm guessing this isn't hard but I just can't find the right code.

Thanks for any help.

DB
Back to top
View user's profile Send private message 
JB4x4

Joined: 30 Jul 2006
Posts: 256

PostPosted: Fri 01 Feb 2008, 21:49    Post subject:  

I can answer the first problem, use the command "mount -t vfat /dev/sda1 /mnt/sda1" to use long filenames. As for the second, I mount a fat32 partition at boot via rc.local (using above command), not sure about a usb drive though.

JB
Back to top
View user's profile Send private message Yahoo Messenger 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Fri 01 Feb 2008, 21:55    Post subject:  

maybe the usb-drivers are not loaded yet.

try to use
probepart > /tmp/bootprobe.txt
in rc.local
Then you can open this File in leafpad to see, what was found.
If the usb-drive is not listed, you might add:
modprobe usb-storage
modprobe ehci-hcd

Mark
Back to top
View user's profile Send private message Visit poster's website 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Fri 01 Feb 2008, 21:58    Post subject:  

Along with the drivers MU mentioned, you might need this one:
modprobe usbcore

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Fri 01 Feb 2008, 21:59    Post subject:  

there also might be other issues, I think rc.local is executed before environment-variables and such are set.
Try to add it in

/etc/profile.local
That is called from /etc/profile, where important stuff is set.
Mark
Back to top
View user's profile Send private message Visit poster's website 
Bruce B


Joined: 18 May 2005
Posts: 10817
Location: The Peoples Republic of California

PostPosted: Sat 02 Feb 2008, 02:32    Post subject:  

I've had identical problems.

1. It would not mount from rc.local AND it would not mount from the command line either. AND it would mount from the CLI AFTER X started.

Prevent X from starting by commenting out exec xwin in /etc/profile. This being the last command in /etc/profile.

When does rc.local run? I think it runs before profile. But does it run without an environment? I don't think so because I've referenced files without full path name and they've ran fine.

So just to be sure, prior to making this post I added this line to rc.local:

echo $PATH>/path.tmp

After rebooting to the prompt, I read /path.tmp and its text was identical to the path statement in /etc/profile and my path statement is modified from the original.

At the time of this post I'm more curious about the sequence of what runs in what order.

Back to a practical approach to DavidBell's problem. I inserted modprobe usb-storage a while back in rc.local and sda is recognized BEFORE X runs.

This information combined with other information I hope helps solve 1/2 the complaint.

--------------------------------------

If you drive is indeed FAT32 I'm curious why mount doesn't automatically see it as VFAT and uses MSDOS mounting.

I would like to think that JB4X4 advice
"mount -t vfat /dev/sda1 /mnt/sda1" would do the trick.

After all, you are specifically TELLING mount what to do in terms of the filesystem extensions you want.

Great if it does.

------------------------------------

My actual experience with mounting Flash Stick at FAT16 was that Puppy Linux would ONLY mount it as MSDOS and thus the unwanted 8.3 naming convention.

It scares me to think that programmers working closely with filesystems don't get some of the fundamentals.

FAT means File Allocation Table. It comes in basically three main flavors FAT12, FAT16 and FAT32.

So what is VFAT? The V means Virtual - it doesn't exist except as a function of drivers of the Operating System accessing the FAT filesystem.

It is about Long File Name support and combining the true DOS names in 8.3 convention with the Microsoft LFN convention all on the same filesystem. This convention is supported in FAT12, FAT16 and FAT32.

There is no more reason Linux should refuse to mount for LFN support on a FAT16 USB device than it should refuse to mount a FAT12 floppy for LFN support.

What happened in my experience is: I formatted a 2GB USB Stick in order to get rid of some unwanted software that would not be deleted. I soon discovered that Puppy Linux would only allow MSDOS 8.3 mounting.

Realizing that this was nonsense I hacked the boot sector and Linux was happy a lark to mount it thereafter as VFAT.

If you find that you are limited to 8.3 filenames, I'll be glad to help you hack the boot sector. If people think FAT16 is not a VFAT driver long file name supported filesystem, it's an illusion. Just because some Linux programmer probably thought FAT32 == VFAT and they are one in the same - this doesn't mean you have to live with the ignorance. You can have your LFNS and your VFAT mountings on all your FATS.

Hopefully just telling mount to do it as vfat will be sufficient.

-------------------

EDIT: for the record I referenced Linux, but the stupid behavior I had was because of the mount utility not Linux as an OS.
Back to top
View user's profile Send private message 
DavidBell

Joined: 24 Nov 2006
Posts: 132

PostPosted: Sat 02 Feb 2008, 19:59    Post subject:  

BruceB, I checked in windows, it is FAT32, but the command

Code:
mount -t vfat /dev/sda1 /mnt/sda1


gives me long file names

On the start up I tried in a few places but the only one that seems close is in /etc/profile.local (even though 2.16 docs say it should be /ete/profile.d/myscript.sh). I put in the following code
Code:
modprobe usbcore
modprobe usb-storage
modprobe ehci-hcd
mount -t vfat /dev/sda1 /mnt/sda1


Anyway at boot I get this error after running rc.local

Code:
mount: Mounting /dev/sda1 to /mnt/sda1 failed. No such file or address.


and the drive is not mounted in Rox. But weirdly enough, if I Ctrl-Alt-Backspace out of X then restart with xwin, the drive is mounted.

So does this mean there is something in X that has to be loaded for it to work? I tried using /root/Startup mentioned in anothe rpost with no success.

DB
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 10817
Location: The Peoples Republic of California

PostPosted: Sun 03 Feb 2008, 19:20    Post subject:  

David,

Yes, it seems to me xwin has to run first. It shouldn't be that way and it did puzzle me when I first stumbled on it.

If you add this line to /etc/fstab you'll probably be able to mount it with ROX very easily after you boot xwin.

/dev/sda1 /mnt/sda1 vfat defaults 0 0


Bruce
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0683s ][ Queries: 11 (0.0157s) ][ GZIP on ]