From: "Kharitonov A. Dmitry" <kharpost@rambler.ru> To: community@lists.altlinux.org Subject: [Comm] Как ядро заставить пересчитать устройство? Date: Tue, 17 Sep 2013 12:46:24 +0400 Message-ID: <523816E0.5050208@rambler.ru> (raw) Требуется получить получить адекватный UUID Вставляю SD карту $ dmesg | tail [ 289.425392] sd 4:0:0:0: [sde] Mode Sense: 03 00 00 00 [ 289.426736] sd 4:0:0:0: [sde] No Caching mode page present [ 289.426757] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 289.436518] sd 4:0:0:0: [sde] No Caching mode page present [ 289.436536] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 289.439109] sde: sde1 sde2 < sde5 > [ 289.444068] sd 4:0:0:0: [sde] No Caching mode page present [ 289.444092] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 289.444114] sd 4:0:0:0: [sde] Attached SCSI removable disk [ 290.576258] FAT-fs (sde1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! $ sudo fdisk -l /dev/sde Disk /dev/sde: 32.3 GB, 32295092224 bytes, 63076352 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x001105d9 Device Boot Start End Blocks Id System /dev/sde1 2048 6293503 3145728 c W95 FAT32 (LBA) /dev/sde2 6293504 63076351 28391424 f W95 Ext'd (LBA) /dev/sde5 6295552 63076351 28390400 b W95 FAT32 $ sudo blkid | grep /dev/sde /dev/sde1: LABEL="tr" UUID="C725-949A" TYPE="vfat" /dev/sde5: LABEL="tr2" UUID="C885-03E6" TYPE="vfat" Внимательно смотрим на UUID="C725-949A" Это всё правильно. Теперь мне нужно переформатировать в ntfs $ sudo umount /dev/sde1 $ sudo umount /dev/sde1 umount: /dev/sde1: not mounted $ sudo umount /dev/sde5 umount: /dev/sde5: not mounted $ sudo dd if=/dev/zero of=/dev/sde count=8k bs=4096 8192+0 records in 8192+0 records out 33554432 bytes (34 MB) copied, 2.94593 s, 11.4 MB/s $ echo -ne "u\nc\nn\np\n\n\n\nt\n7\na\n1\nw\n" | sudo fdisk -S56 /dev/sde Welcome to fdisk (util-linux 2.22.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x218d0787. Command (m for help): Changing display/entry units to cylinders (DEPRECATED!) Command (m for help): DOS Compatibility flag is set (DEPRECATED!) Command (m for help): Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): Partition number (1-4, default 1): Using default value 1 First cylinder (1-17599, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-17599, default 17599): Using default value 17599 Partition 1 of type Linux and of size 30.1 GiB is set Command (m for help): Selected partition 1 Hex code (type L to list codes): Changed system type of partition 1 to 7 (HPFS/NTFS/exFAT) Command (m for help): Partition number (1-4): Command (m for help): The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. $ sudo fdisk -l /dev/sde Disk /dev/sde: 32.3 GB, 32295092224 bytes, 63076352 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x218d0787 Device Boot Start End Blocks Id System /dev/sde1 * 56 63074815 31537380 7 HPFS/NTFS/exFAT $ sudo mkfs.ntfs -f -c 4096 -L test /dev/sde1 Creating NTFS volume structures. mkntfs completed successfully. Have a nice day. А теперь внимание $ sudo blkid | grep /dev/sde /dev/sde1: LABEL="tr" UUID="C725-949A" TYPE="vfat" UUID не изменился!!! $ sudo partprobe $ sudo blkid | grep /dev/sde /dev/sde1: LABEL="tr" UUID="C725-949A" TYPE="vfat" вынимаю и вставляю $ dmesg | tail [ 918.870892] sd 5:0:0:0: [sde] Write Protect is off [ 918.870910] sd 5:0:0:0: [sde] Mode Sense: 03 00 00 00 [ 918.872078] sd 5:0:0:0: [sde] No Caching mode page present [ 918.872093] sd 5:0:0:0: [sde] Assuming drive cache: write through [ 918.877223] sd 5:0:0:0: [sde] No Caching mode page present [ 918.877233] sd 5:0:0:0: [sde] Assuming drive cache: write through [ 918.878631] sde: sde1 [ 918.882372] sd 5:0:0:0: [sde] No Caching mode page present [ 918.882382] sd 5:0:0:0: [sde] Assuming drive cache: write through [ 918.882390] sd 5:0:0:0: [sde] Attached SCSI removable disk $ sudo blkid | grep /dev/sde /dev/sde1: LABEL="tr" UUID="C725-949A" TYPE="vfat" После перезагрузки $ dmesg | tail [ 139.522377] sd 4:0:0:0: [sde] Mode Sense: 03 00 00 00 [ 139.523479] sd 4:0:0:0: [sde] No Caching mode page present [ 139.523495] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 139.531353] sd 4:0:0:0: [sde] No Caching mode page present [ 139.531369] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 139.532754] sde: sde1 [ 139.536356] sd 4:0:0:0: [sde] No Caching mode page present [ 139.536369] sd 4:0:0:0: [sde] Assuming drive cache: write through [ 139.536381] sd 4:0:0:0: [sde] Attached SCSI removable disk [ 144.687148] fuse init (API version 7.20) $ sudo blkid | grep /dev/sde /dev/sde1: LABEL="test" UUID="2130BC3E3BF9C94B" TYPE="ntfs" За какую ручку дёргать чтоб не перезагружаться?
next reply other threads:[~2013-09-17 8:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-09-17 8:46 Kharitonov A. Dmitry [this message] 2013-09-17 8:52 ` Pavel Vainerman 2013-09-18 3:53 ` Kharitonov A. Dmitry
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=523816E0.5050208@rambler.ru \ --to=kharpost@rambler.ru \ --cc=community@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git