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 19 Jun 2013, 06:16
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 Posts_count  
Author Message
der-schutzhund

Joined: 26 Nov 2007
Posts: 747
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

Edited_time_total
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 2273
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 "To err is human; to really foul things up, you need a computer!" / "L'erreur est humaine; pour vraiment f... la m..., il faut un ordinateur." (Carleton University, banderole à la Rentrée 1979 / banner, start of 1979 school year) Wink
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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