How to mount a SD-card

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

How to mount a SD-card

Beitrag von vleeuwen » 12 Jan 2019, 13:16

How to mount a SD-card on a TXT?
I have an fat32 formatted sd-card in the TXT with firmware 4.4.4.0 before starting up the TXT
I have an ssh connection (Putty) and a sftp connection (FileZilla).

I tried to follow the description:
viewtopic.php?f=21&t=4240&p=30798&hilit=mount+SD#p30798
But that does not work.
$ mount /dev/mmcblk0p0
mount: can't find /dev/mmcblk0p0 in /etc/fstab
$ fdisk -l
Does not give any device.

What command steps I need to perform on the TXT?

Benutzeravatar
PHabermehl
Beiträge: 2429
Registriert: 20 Dez 2014, 22:59
Wohnort: Bad Hersfeld

Re: How to mount a SD-card

Beitrag von PHabermehl » 12 Jan 2019, 16:15

Haven't tried on the TXT, but since it's Linx...


Obviously the device is not listed in fstab, so you have to use the mount command another way:

Code: Alles auswählen

mount -t vfat /dev/<devicename> <mount path>
check for the device name using

Code: Alles auswählen

ls /dev/
Maybe you should insert the card after booting, do a ls before and after insertion to find out which device was added.

Then issue the mount command. <mount path> has to be some file path on your TXT where the card will be assigned to. Maybe you have to create one like

Code: Alles auswählen

mkdir /mnt/sdcard
and then mount -t vfat /dev/mmcblk0p0 /mnt/sdcard.

Also, you might have to change the access rights for that directory if you want to write to the card. "chmod" would be the command.

For safety reasons you also should unmount the card before removing!

Code: Alles auswählen

umount /mnt/sdcard
would do so.

Good luck
Peter
https://www.MINTronics.de -- der ftDuino & TX-Pi Shop!

viele Grüße
Peter

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: How to mount a SD-card

Beitrag von vleeuwen » 12 Jan 2019, 19:42

Thanks.
This was not working at ROBOPro level so I switch to root level.

For the device identity:

Code: Alles auswählen

# sudo fdisk -l
Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type
/dev/mmcblk0p1 0,130,3 966,80,10 8192 15523839 15515648 7576M b Win95 FAT32

I created an entry :

Code: Alles auswählen

mkdir /opt/sd
and mounted the card:
mount -t vfat /dev/mmcblk0p0 /opt/sd

How can I extend the fstab file?
/etc/fstab
# <file system> <mount pt> <type> <options> <dump> <pass>
……….
……..
/dev/mmcblk0p0 /opt/sd vfat ???? ( mode=0755) ???(0) ??? (0)
or can this be a problem in relation with the other fuctionality namely use as boot drive?

Antworten