Sponsored Content
Top Forums Shell Programming and Scripting Automating partitioning setup of /dev/sda on /dev/sdc Post 302944772 by Corona688 on Thursday 21st of May 2015 05:28:46 PM
Old 05-21-2015
dd if=/dev/sda of=/mnt/USBDrive/dd/partition-restore bs=1 count=2047 will give you 2047 bytes, not blocks, because you have set the block size to 1. Use bs=512, or just leave out bs entirely, since dd will assume 512 when you don't tell it otherwise. I think you want 2048, not 2047, as well.

There is no 'sector', 'cylinder', 'head', 'track', etc, etc, etc. None of that has been relevant for going on 20 years. Hard drives do have a block size though, of 512 bytes (and even the very newest drives, which use 4K blocks internally, still act like they have 512 byte blocks.)

34612341692783461 lines of script aren't going to help you when you don't know how to do it by hand.
This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. Solaris

URGENT - setup port and dump all output to /dev/null or a file

Please help urgently. I need to setup up some sort of service on a solaris server on a port. I dont need it do anything special, anything that is sent to this port from an external server should be dump to /dev/null or a flat file.. Can you help urgently? (1 Reply)
Discussion started by: frustrated1
1 Replies

2. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

3. UNIX for Dummies Questions & Answers

Sending alt-n to /dev/pts/1 from process bound to /dev/pts/2

Hello, i am using finch (unix commandline instant messaging client using libgnt) which is running connected to /dev/pts/1 Now I would like to "remote control" the program by sending the key combinations normally typed on the keyboard from a programm in another shell. So I tried:... (0 Replies)
Discussion started by: mentos
0 Replies

4. Slackware

CUPS setup / dev/lp0 perms. ... Slow printing.

Hello, Ive got an HP LaserJet 2100 / parallel interface. I had some troubles getting going due to non-working cups drivers. Updated cups and also used a .ppd.gz file from something HP provided. found the files here... www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_2100 Anyways.... (1 Reply)
Discussion started by: agentrnge
1 Replies

5. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

6. AIX

Difference between /dev/hdisk and /dev/rhdisk

Hi, How can i check that i am using RAW devices for storage in my AIX machine... Also after adding a LUN from storage to a aix host, when i check /dev in the host, i can see both rhdisk and hdisk with same number eg: dcback1(root):/dev>ls -lrt | grep disk12 crw------- 1 root ... (4 Replies)
Discussion started by: jibujacob
4 Replies

7. AIX

Problem in /dev/hd1 and /dev/hd9var

Hello AIXians, I can't boot my AIX, it hangs and stops at the code error: 0518 After searching google, I knew the problem is due to problems in File Systems. So the solution is booting from any bootable media, then run these commands in maintenance mode: #fsck -y /dev/hd4 #fsck -y... (3 Replies)
Discussion started by: Mohannad
3 Replies

8. Red Hat

Changing grub from /dev/sda to /dev/sdb

Hi, Please suggest steps to change grub from /dev/sda to /dev/sdb, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

9. HP-UX

Dev/urandom and dev/random missing in HP-UX

Hi, In our HP-UX B.11.11. I could not find dev/urandom and dev/random Are all pseudo-devices implemented as device drivers, or in need to run /configure some package to install the package to have dev/urandom. Please help (4 Replies)
Discussion started by: rashi
4 Replies
XP(4)							     Kernel Interfaces Manual							     XP(4)

NAME
xp - generic SMD moving-head disk SYNOPSIS
/sys/conf/SYSTEM: NXPC xp_controllers # Number of controllers NXPD xp_drives # RM02/03/05, RP04/05/06, # CDC 9766, Fuji 160, etc. BADSECT NO # Bad sector handling (see BUGS) /etc/dtab: #Name Unit# Addr Vector Br Handler(s) # Comments xp ? 176700 254 5 xpintr # xp driver major device number(s): raw: 19 block: 10 minor device encoding: bits 0007 specify partition of XP drive bits 0370 specify XP drive DESCRIPTION
The xp driver is a generic SMD storage module disk driver. It can be adapted to most SMD controllers although bootstrapping will not nec- essarily be directly possible. The drives are numbered from 0 to n on controller 0, from n+1 to m on controller 1, etc. The drives may have different geometries. The xp driver is unique amoungst 2BSD drivers in its numbering of drives. Other drivers (ra for example) number drives 0 thru 7 on con- troller 1, 8 thru 15 on controller 2 and so on. xp on the other hand can have drives 0 and 1 on controller 1, drives 2, 3, 4 and 5 on con- troller 2 and drives 6, 7 and 8 on controller 3. This is different from boot's view of the world, so if you are booting from other than unit 0 you may have to experiment a bit. Files with minor device numbers 0 through 7 refer to various portions of drive 0; minor devices 8 through 15 refer to drive 1, etc. The standard device names begin with ``xp'' followed by the drive number and then a letter a-h for partitions 0-7 respectively. The character ? stands here for a drive number in the range 0-7. The block files access the disk via the system's normal buffering mechanism and may be read and written without regard to physical disk records. There is also a `raw' interface which provides for direct transmission between the disk and the user's read or write buffer. A single read or write call results in exactly one I/O operation and therefore raw I/O is considerably more efficient when many words are transmitted. The names of the raw files conventionally begin with an extra `r.' In raw I/O the buffer must begin on a word (even) boundary, and counts should be a multiple of 512 bytes (a disk sector). Likewise lseek calls should specify a multiple of 512 bytes. DISK SUPPORT
Disks must be labeled using either the standalone disklabel program on the boot tape or with the disklabel(8) program. The kernel no longer attempts to determine the drive type and geometry, instead reading this information from the disklabel. There are no partition tables coded into the xp driver, these must be placed on the drive with disklabel. Special files should only be created for the partitions that are actually used, as the overlap in these addresses could lead to confusion otherwise. Traditionally the xp?a partition is normally used for the root file system, the xp?b partition as a swap area, and the xp?c partition for pack-pack copying (it maps the entire disk). FILES
/dev/xp[0-7][a-h] block files /dev/rxp[0-7][a-h] raw files /dev/MAKEDEV script to create special files /dev/MAKEDEV.local script to localize special files SEE ALSO
hk(4), ra(4), ram(4), rk(4), rl(4), rp(4), rx(4), si(4), dtab(5), autoconfig(8), newfs(8) DIAGNOSTICS
xp%d%c: hard error sn%d cs2=%b er1=%b. An unrecoverable error occurred during transfer of the specified sector of the specified disk par- tition. The contents of the two error registers are also printed in octal and symbolically with bits decoded. The error was either unre- coverable, or a large number of retry attempts (including offset positioning and drive recalibration) could not recover the error. xp%d: write locked. The write protect switch was set on the drive when a write was attempted. The write operation is not recoverable. xp%d%c: soft ecc sn%d. A recoverable ECC error occurred on the specified sector of the specified disk partition. This happens normally a few times a week. If it happens more frequently than this the sectors where the errors are occurring should be checked to see if certain cylinders on the pack, spots on the carriage of the drive or heads are indicated. xp%d: unknown device type 0%o. The number in the drive's drive type register is unknown to the xp driver. BUGS
In raw I/O read and write(2) truncate file offsets to 512-byte block boundaries, and write scribbles on the tail of incomplete blocks. Thus, in programs that are likely to access raw devices, read, write and lseek(2) should always deal in 512-byte multiples. DEC-standard error logging should be supported. The kernel uses partition 'h' to access the badblock information. This should have been 'c' except that almost all of the /etc/disktab entries (and thus existing systems) use 'h' for this purpose. Unless you are very careful with disklabel|(8) (to make certain that no data partition overlaps the badblock area) you should probably leave BADSECT undefined in the kernel config file. 3rd Berkeley Distribution August 14, 1995 XP(4)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy