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 Wed 22 May 2013, 17:32
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
[solved]: How to find the format of a not mounted drive?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
der-schutzhund

Joined: 26 Nov 2007
Posts: 728
Location: Blomberg / Germany

PostPosted: Sun 03 Mar 2013, 16:00    Post subject:  [solved]: How to find the format of a not mounted drive?  

Hi,

i want to mount all drives automatically to mount them in a script.
Do you now how a script can test the format?

With this script i can mount all drives but the ntfs drives are then read only!

Code:
!/bin/bash -a
# Sort out swap and mounted partitions
blkid  | egrep '(hd|sd)' | egrep -v "/dev/loop*" | egrep -v "swap" | cut -f 1 -d ':' | sed 's/\/dev\///'>/tmp/list_of_drives
for drive in  `cat /tmp/list_of_drives` ; do
   mkdir -p /mnt/$drive
   mount /dev/$drive /mnt/$drive
   echo $drive
done
exit 0


With this i can mount a ntfs but I do not know if it's a ntfs drive or not!

Code:
   mount -t ntfs /dev/$drive /mnt/$drive


The solution: --------------------------------------
Code:
blkid  | egrep '(hd|sd)' | egrep -v "/dev/loop*" | egrep -v "swap" | cut -f 1 -d ':' | sed 's/\/dev\///'>/tmp/list_of_drives
for drive in  `cat /tmp/list_of_drives` ; do
   mkdir -p /mnt/$drive
   if [ "`blkid /dev/$drive | grep -o "TYPE=.*" | cut -f2 -d '"'`" = "ntfs" ]; then
     mount -t ntfs /dev/$drive /mnt/$drive
   else
     mount /dev/$drive /mnt/$drive
   fi
   echo $drive
done 


Special thangs to SFR !

Greetings

Wolfgang

Last edited by der-schutzhund on Mon 04 Mar 2013, 11:27; edited 1 time in total
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 2211
Location: Gatineau (Qc), Canada

PostPosted: Sun 03 Mar 2013, 23:05    Post subject:  

I don't know the reason, and I'm no great specialist, but I believe you need an utility or a group of utilties called "ntfs-3g" to deal with ntfs disk format from a Linux distro.

Best regards.

musher0

_________________
Wink "...l'industrie de l'informatique n'aura besoin que de très peu de temps pour ramener l'humanité aux dessins rupestres." (M. Goebbel, Order of the Command Line; [ma trad.])
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 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.0383s ][ Queries: 12 (0.0037s) ][ GZIP on ]