Tag Info

Hot answers tagged

23

Naturally, you need to unmount any filesystems on the disk, and it'd be a good idea to deactivate any LVM groups (vgchange -an), and generally make sure nothing is using the disk for anything. Once you've done that, it should be safe to unplug. If you want to be extra cautious, do echo 1 > /sys/block/(whatever)/device/delete first. That'll unregister ...


12

Depending on your SATA driver and your distribution's configuration, they might show up as /dev/hda and /dev/hdb, or /dev/hda and /dev/sda, or /dev/sda and /dev/sdb. Distributions and drivers are moving towards having everything hard disk called sd?, but PATA drivers traditionally used hd? and a few SATA drivers also did. The device names are determined by ...


8

Bad sectors are always an indication of a failing HDD, in fact the moment you see an I/O error such as this, you probably already lost/corrupted some data. Make a backup if you haven't one already, run a self test smartctl -t long /dev/disk and check SMART data smartctl -a /dev/disk. Get a replacement if you can. Bad sectors can't be repaired, only replaced ...


7

They show up as SCSI devices because the drivers speak SCSI to the next kernel layer (the generic disk driver). This isn't actually true of all SATA drivers on all kernel versions with all kernel compile-time configurations, but it's common. Even PATA devices can appear as SCSI at that level (again, that depends on the kernel version and kernel compile-time ...


6

I wrote one-liner based on Tobi Hahn answer. For example, you want to know what device stands for ata3: ata=3; ls -l /sys/block/sd* | grep $(grep $ata /sys/class/scsi_host/host*/unique_id | awk -F'/' '{print $5}') It will produce something like this lrwxrwxrwx 1 root root 0 Jan 15 15:30 /sys/block/sde -> ...


6

You write to the disk (/dev/sdb), not to the file system you created (/dev/sdb1). Since an ISO image already contains a file system (which you don't want) you can simply mount the ISO (with option -o loop) and copy the data to /dev/sdb1. That way the file system is preserved.


5

To see the device description for the controller (assuming an internal (PCI) controller), which usually contains SATA for SATA controllers: lspci -d $(cat /sys/block/sda/device/../../../vendor):$(cat /sys/block/sda/device/../../../device) If you want to type less, just browsing the output of lspci is likely to give you the answer in a laptop (many desktop ...


5

I puzzled a bit around what would be the enumeration scheme on my systems and I've came up with following algorithm: The /dev/sdY devices are created in the same order as the ataX identifiers are enumerated in the kern.log while ignoring non-disk devices (ATAPI) and not-connected links. Thus, following command displays the mapping: $ grep '^May 28 2' ...


5

ata2.00: ATA-8: ST2000DM001-1CH164, CC24, max UDMA/133 ATA-8 is the version (SATA II). ST2000DM001-1CH164 is the device model number. CC24 is the device firmware version. UDMA/133 would be the speed, if this were a PATA device instead of SATA. ata2.00: 3907029168 sectors, multi 16: LBA48 NCQ (depth 31/32), AA Sector count should be obvious. Multi is the ...


5

Turns out doing the mapping was easier than I realized. dmesg | grep ata2 | head gives the kernel's mapping of the drive during the boot process. Or you could just go for ata2.00 right away. [ 2.448300] ata2: SATA max UDMA/133 abar m1024@0xfeb0b000 port 0xfeb0b180 irq 19 [ 2.940139] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) [ ...


4

No, bad sectors are not always an indication of a failing drive. Sometimes if a write is in progress at the time of a power failure, the data in the sector will be corrupted, resulting in an error when you try to read it. Attempting to write new data to the sector may work just fine since there's nothing physically wrong with it. You can run badblocks -n ...


3

I think you can get what you want by cross referencing the output from lshw -c disk and this command, udevadm info -q all -n <device>. For example My /dev/sda device shows the following output for lshw: $ sudo lshw -c disk *-disk description: ATA Disk product: ST9500420AS vendor: Seagate physical id: 0 ...


3

I have found the solution. The device was unclaimed because it was not known correctly by the kernel. Using a kernel 3.5, the device was listed as below: *-ide UNCLAIMED description: IDE interface product: ASM1061 SATA IDE Controller vendor: ASMedia Technology Inc. physical id: 0 ...


3

Use this command: ls -l /sys/block/sd* | sed 's/.*\(sd.*\) -.*\(ata.*\)\/h.*/\2 => \1/' On my system this produces the output: ata1 => sda ata2 => sdb ata3 => sdc ata4 => sdd ata7 => sde ata8 => sdf This will work even if all disks have the same drive model (between those 6 disks there are only two different models). Note that ...


3

LVM doesn't care what the underlying block devices are so you can mix any physical devices, or even software raid devices and it just works.


3

Those two sections are for different things. The first is for unplugging. The second is for plugging. For unplugging, the OS will sync the data during the unmount operation. Thus, if the disk is unmounted (assuming you in fact do have full hardware support) you can power off the disk then unplug it without risk of data loss or corruption. For plugging, ...


3

To answer the first question: Yes But anyway, it should be easy to generate a backup entry in your boot manager (with the original initrd and working kernel), in case something goes wrong. To answer the second one - you can use $ lsmod Module Size Used by ... On your running systems to see, if ata_generic is loaded and if it is, which ...


2

Here's my version, modified from above. Since I don't know the exact date the system was booted (for testing this it was 27 days ago), and I don't know which kern.log contains the data I need (some may be gzipped on my system), I use uptime and date to calculate an approximate system boot date (to the day, anyway), then use zgrep to search through all ...


2

The default order in which sda, sdb, sdc are assigned is unpredictable. But it can be overridden through udev. You can control the name of the block device files by adding directives in /etc/udev/rules.d/local.rules (some (older?) systems may only support /etc/udev/rules.conf). Better, you can add directives to create symbolic links, and use those symbolic ...


2

The SATA driver uses the SCSI kernel modules. You'll need scsi_mod and sd_mod at least, I'm not sure about scsi_transport_spi, it's certainly not loaded on any of my SATA-only systems.


2

I'm currently running CentOS on some old hardware and using a USB interface to a hot swap bay for testing these, but it's not really an ideal solution. A USB-to-SATA adapter probably won't work for this, because they usually don't allow you to run SMART commands. I'd use SATA directly for this. If that's not an option, you will need a USB-to-SATA ...


2

I don't see any points on doing so, you want a Volume Group that contains both SATA and SSD, that's possible. Just create multiple PVs, with pvcreate /dev/partition_name And create a volume group that use those PVs, with vgcreate And do the partition of that VG.


2

That's not what dd is for and that's not how dd works. If you want the contents of the ISO then you can loopback mount it and copy the individual files. However, you seem to be wanting to copy the contents of the Ubuntu installer onto a hard disk that presumably you'll want to boot from. Again, that's not how it works. Optical disks (CD/DVD) use the ISO ...


2

Ok I guessing this is a udev issue (most Linux distros use this by default), this is what creates the symlinks. You can fix this by add a new rule. I will give some info on this, but it is largely anchored in my own distro - Debian. First off, you need to find where your rules are. Debian has them in two locations - /lib/udev/rules.d and /etc/udev/rules.d. ...


2

Get your current config.gz and deploy it in a source tree as described in this answer. Start make menuconfig and go into the "Device Drivers" submenu. Make sure "Serial ATA and Parallel ATA drivers (libata)" is disabled. Scroll down to the "USB support" sub-submenu and make sure "USB Mass Storage" is disabled. You could completely disable USB too if you ...


1

RHEL's limitations are core- and RAM-based, not drive count-based; the wording is hinting at few chassis being able to mount more than 10 or so drives. Linux itself is limited to 128 SCSI drive devices (sda through sddx).


1

I assume your laptop has a CDROM drive. If so, could you install your netbook's drive in your laptop (as opposed to connecting it via USB) and then install Ubuntu on it. After that put it back in your netbook. Not sure how dependent an Ubuntu installtion is on the actual hardware so you might need to do something after the drive is back in the netbook to ...


1

what about eject /dev/sdX? On my setup, this commands umounts, syncs and powers down the drive.


1

As a rule of thumb, always turn off fakeraid (RAID which is declared in the BIOS but actually performed by an OS driver). Fakeraid only exists for two reasons: because some OSes have no native RAID capabilities and need some external assistance; because it lets hardware manufacturers advertise a feature that they aren't really implementing. There is no ...


1

There are two indications from this output that it is. First it indicates that the driver is in use(sata_via). The second is that it says what kind of card it is after the PCI address in the first line. If the driver is not loaded properly it'll say something like "Unknown Device ID 4000x288...".



Only top voted, non community-wiki answers of a minimum length are eligible