Partitionen in /dev fehlen

Du kommst mit der Installation nicht voran oder willst noch was nachfragen? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Partitionen in /dev fehlen

Beitrag von latenite » 26.09.2009 23:51:07

Hallo Debianfreunde

ich bastle gerade an einem Script das mir die Installation von Debian erleichtern soll. In dem Script partitioniere ich mit fdisk. Dann lasse ich mir die erstellten Partitionen anzeigen um sie zum formatierne auswählen zu können:

so etwa:

Code: Alles auswählen

function formating() {
PARTITIONS=`find /dev/ -type b | cat`
	cat << EOF
################################################################################
# Formating...
# Example of recommendet partitions:
# /dev/Xdx[0-9]		/boot	(100M, ext3)
# /dev/Xdx[0-9]		/	(15G)
# /dev/Xdx[0-9]		/swap	(`free -m|tail -n+2|head -n1|cut -d ":" -f 2|sed 's/^[ \t]*//g'|cut -d " " -f1`M)
# /dev/Xdx[0-9]		/home	(>1G)
# /dev/Xdx[0-9]		/tmp 	(`free -m|tail -n+2|head -n1|cut -d ":" -f 2|sed 's/^[ \t]*//g'|cut -d " " -f1`M)
# /dev/Xdx[0-9]		/usr	(>10G)
# /dev/Xdx[0-9]		/var	(>10G)
# /dev/Xdx[0-9]		/data	(up to you)
# Be aware that FAT32 does NOT support sysmlinks NOR journaling
# Select the partitions you want to format by number: 
################################################################################
EOF
	fdisk -l
	select partition in $PARTITIONS; do
	break; done
	cat << EOF
################################################################################
# Information about $partition:
################################################################################
EOF
	tune2fs -l $partition
	fdisk -l $partition
cat << EOF
################################################################################
# Enter the filesystemformat for $partition (ext3 is recommendet) :
################################################################################
EOF
	ls -l /sbin/mkfs* | cut -d"/" -f3 | cut -d"." -f2  | tail -n +2
	# add swap to the list of choices
	echo "swap"
	read fsformat
cat << EOF
################################################################################
# Enter a label (name) for $partition
################################################################################
EOF
	read label
	if [ "$fsformat" == "swap" ]; then
		mkswap $partition
	else
		mkfs.$fsformat $partition
	fi
	e2label $partition $label
	tune2fs -c 0 $partition
	rerun_funktion_yn ${FUNCNAME}
} # end of formating
formating
Das Problem ist, das fdisk zwar neue Partitionen erstellt sie aber unter /dev nicht angezeigt werden. Wenn sie nicht angezeigt werden kann ich sie im Script auch nicht zum formatiern auswählen.

Hier mal zum angucken:

Code: Alles auswählen

The number of cylinders for this disk is set to 16539.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Command (m for help): q

################################################################################
# echo -n "Do want to keep on with partitioning? y/n :
################################################################################
n

################################################################################
# Formating...
# Example of recommendet partitions:
# /dev/Xdx[0-9]		/boot	(100M, ext3)
# /dev/Xdx[0-9]		/	(15G)
# /dev/Xdx[0-9]		/swap	(885M)
# /dev/Xdx[0-9]		/home	(>1G)
# /dev/Xdx[0-9]		/tmp 	(885M)
# /dev/Xdx[0-9]		/usr	(>10G)
# /dev/Xdx[0-9]		/var	(>10G)
# /dev/Xdx[0-9]		/data	(up to you)
# Be aware that FAT32 does NOT support sysmlinks NOR journaling
# Select the partitions you want to format by number: 
################################################################################

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Disk /dev/sdb: 8053 MB, 8053063680 bytes
218 heads, 14 sectors/track, 5153 cylinders
Units = cylinders of 3052 * 512 = 1562624 bytes
Disk identifier: 0x000555de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         400      609279+  83  Linux
/dev/sdb2             400        1774     2097844   83  Linux
/dev/sdb3            1775        5153     5156354   83  Linux
1) /dev/loop7	 9) /dev/sdb3	17) /dev/sda7	25) /dev/ram8	33) /dev/ram14
2) /dev/loop6	10) /dev/sdb2	18) /dev/sda5	26) /dev/ram7	34) /dev/ram13
3) /dev/loop5	11) /dev/sdb1	19) /dev/sda3	27) /dev/ram6	35) /dev/ram12
4) /dev/loop4	12) /dev/sdb	20) /dev/sda4	28) /dev/ram5	36) /dev/ram11
5) /dev/loop3	13) /dev/sda10	21) /dev/sda2	29) /dev/ram4	37) /dev/ram10
6) /dev/loop2	14) /dev/sda9	22) /dev/sda1	30) /dev/ram3	38) /dev/ram1
7) /dev/loop1	15) /dev/sda6	23) /dev/sda	31) /dev/ram2	39) /dev/ram0
8) /dev/loop0	16) /dev/sda8	24) /dev/ram9	32) /dev/ram15
#? ^Cpendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# PARTITIONS=`find /dev/ -type b | cat`
pendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# echo $PARTITIONS
/dev/loop7 /dev/loop6 /dev/loop5 /dev/loop4 /dev/loop3 /dev/loop2 /dev/loop1 /dev/loop0 /dev/sdb3 /dev/sdb2 /dev/sdb1 /dev/sdb /dev/sda10 /dev/sda9 /dev/sda6 /dev/sda8 /dev/sda7 /dev/sda5 /dev/sda3 /dev/sda4 /dev/sda2 /dev/sda1 /dev/sda /dev/ram9 /dev/ram8 /dev/ram7 /dev/ram6 /dev/ram5 /dev/ram4 /dev/ram3 /dev/ram2 /dev/ram15 /dev/ram14 /dev/ram13 /dev/ram12 /dev/ram11 /dev/ram10 /dev/ram1 /dev/ram0
pendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# find /dev/ -type b
/dev/loop7
/dev/loop6
/dev/loop5
/dev/loop4
/dev/loop3
/dev/loop2
/dev/loop1
/dev/loop0
/dev/sdb3
/dev/sdb2
/dev/sdb1
/dev/sdb
/dev/sda10
/dev/sda9
/dev/sda6
/dev/sda8
/dev/sda7
/dev/sda5
/dev/sda3
/dev/sda4
/dev/sda2
/dev/sda1
/dev/sda
/dev/ram9
/dev/ram8
/dev/ram7
/dev/ram6
/dev/ram5
/dev/ram4
/dev/ram3
/dev/ram2
/dev/ram15
/dev/ram14
/dev/ram13
/dev/ram12
/dev/ram11
/dev/ram10
/dev/ram1
/dev/ram0
pendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda10  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sda6	/dev/sda7  /dev/sda8  /dev/sda9  /dev/sdb  /dev/sdb1  /dev/sdb2  /dev/sdb3
pendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# fdisk -l

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Disk /dev/sdb: 8053 MB, 8053063680 bytes
218 heads, 14 sectors/track, 5153 cylinders
Units = cylinders of 3052 * 512 = 1562624 bytes
Disk identifier: 0x000555de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         400      609279+  83  Linux
/dev/sdb2             400        1774     2097844   83  Linux
/dev/sdb3            1775        5153     5156354   83  Linux
pendrive:/media/usb_data/system_setup/system_tree/usr/local/bin/myscripts/auto_debootstrep# 
Was mache ich da falsch?

Danke schon mal :D

Benutzeravatar
towo
Beiträge: 4559
Registriert: 27.02.2007 19:49:44
Lizenz eigener Beiträge: GNU Free Documentation License

Re: Partitionen in /dev fehlen

Beitrag von towo » 26.09.2009 23:55:16

Bau nach dem Partitionieren ein

Code: Alles auswählen

blockdev --rereadpt /dev/foo
in Dein Script ein, um die neue Partitionstabelle(n) neu einzulesen.

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 00:15:04

ich hab partprobe aus dem parted packet probiert (error)

und das /dev/FOO geht nicht?

Code: Alles auswählen

pendrive:/home/user# partprobe
Error: Error informing the kernel about modifications to partition /dev/sda12 -- Device or resource busy.  This means Linux won't know about any changes you made to /dev/sda12 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Warning: The kernel was unable to re-read the partition table on /dev/sda (Device or resource busy).  This means Linux won't know anything about the modifications you made until you reboot.  You should reboot your computer before doing anything with /dev/sda.
pendrive:/home/user# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda10  /dev/sda11  /dev/sda5	/dev/sda6  /dev/sda7  /dev/sda8  /dev/sda9
pendrive:/home/user# fdisk -l

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Disk /dev/sdb: 8053 MB, 8053063680 bytes
218 heads, 14 sectors/track, 5153 cylinders
Units = cylinders of 3052 * 512 = 1562624 bytes
Disk identifier: 0x000555de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         400      609279+  83  Linux
/dev/sdb2             400        1774     2097844   83  Linux
/dev/sdb3            1775        5153     5156354   83  Linux
pendrive:/home/user# blockdev --rereadpt /dev/foo
/dev/foo: Datei oder Verzeichnis nicht gefunden
pendrive:/home/user# 

Benutzeravatar
towo
Beiträge: 4559
Registriert: 27.02.2007 19:49:44
Lizenz eigener Beiträge: GNU Free Documentation License

Re: Partitionen in /dev fehlen

Beitrag von towo » 27.09.2009 00:17:29

und das /dev/FOO geht nicht?
Willst Du mich verarschen?
Für Foo mußt du das Device schreiben!

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 00:28:37

verarschen? NICHTS wäre mir fremder!! Wenn ich mal was "vermassel" dann unabsichtlich. In diesem Fall habe ich foo UND sda probiert.

Code: Alles auswählen

pendrive:/home/user# hdparm -z /dev/sda

/dev/sda:
 re-reading partition table
 BLKRRPART failed: Device or resource busy
pendrive:/home/user# blockdev --rereadpt /dev/sda
BLKRRPART: Das Gerät oder die Ressource ist belegt
pendrive:/home/user# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda10  /dev/sda11  /dev/sda5	/dev/sda6  /dev/sda7  /dev/sda8  /dev/sda9
pendrive:/home/user# fdisk -l

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Disk /dev/sdb: 8053 MB, 8053063680 bytes
218 heads, 14 sectors/track, 5153 cylinders
Units = cylinders of 3052 * 512 = 1562624 bytes
Disk identifier: 0x000555de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         400      609279+  83  Linux
/dev/sdb2             400        1774     2097844   83  Linux
/dev/sdb3            1775        5153     5156354   83  Linux
pendrive:/home/user# 

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 00:30:12

Man ich bin echt dankbar das es in diesem Forum so tolle Hilfe gibt. Verarschen wäre da echt unangebracht. Oder?!

was ich nicht verstehe....warum is da device busy? hmmmm :?

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 00:42:51

Code: Alles auswählen

pendrive:/home/user# sfdisk -R /dev/sda
BLKRRPART: Das Gerät oder die Ressource ist belegt
pendrive:/home/user# 
geht auch nicht! :cry: :cry: :cry:

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 01:00:24

fdisk sagt ja auch wenn's fertig ist das der kernel noch die alte Tabelle hat...und will das ich reboote

"The new table will be used at the next reboot."

War das nicht mal anders....Linux muss man nicht rebooten?! :roll: :wink:

Soll ich mal die Platte rausziehen?...lach nene
Aber was mache ich jetzt? (rebooten kommt nicht in frage, weil das ja ialles mal im script laufen soll...)

danke

Code: Alles auswählen

pendrive:/home/user# fdisk /dev/sda

The number of cylinders for this disk is set to 16539.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Command (m for help): d
Partition number (1-12): 12

Command (m for help): p

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (6867-16539, default 6867): 
Using default value 6867
Last cylinder or +size or +sizeM or +sizeK (6867-16539, default 16539): 
Using default value 16539

Command (m for help): p

Disk /dev/sda: 128.0 GB, 128035676160 bytes
240 heads, 63 sectors/track, 16539 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x9bfb4b10

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       16539   125034808+   5  Extended
/dev/sda5               1          14      105777   83  Linux
/dev/sda6              15        2598    19535008+  83  Linux
/dev/sda7            2599        2857     1958008+  83  Linux
/dev/sda8            2858        4150     9775048+  83  Linux
/dev/sda9            4151        4280      982768+  83  Linux
/dev/sda10           4281        5573     9775048+  83  Linux
/dev/sda11           5574        6866     9775048+  83  Linux
/dev/sda12           6867       16539    73127848+  83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Das Gerät oder die Ressource ist belegt.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
pendrive:/home/user# 


Benutzeravatar
catdog2
Beiträge: 5352
Registriert: 24.06.2006 16:50:03
Lizenz eigener Beiträge: MIT Lizenz

Re: Partitionen in /dev fehlen

Beitrag von catdog2 » 27.09.2009 13:30:48

Kannst ja mal hdparm probiern:

Code: Alles auswählen

       -z     Force a kernel re-read of the partition table of the specified device(s).
Unix is user-friendly; it's just picky about who its friends are.

latenite
Beiträge: 688
Registriert: 14.05.2007 01:04:23

Re: Partitionen in /dev fehlen

Beitrag von latenite » 27.09.2009 17:23:56

ich mache das von ndem livestick aus. Habe 2 Sticks. Bei dem Einen gehts bei dem andern nicht.
Da ich "fertig" werden will....nehm ich einfach den der funktioniert.
Sind bstimmt irgendwelche Kernel-dings bei dem einen Stick...

p.s. auch hdparm versagt...

egal..ich nehm nen andern stick..schonok :)

Antworten