EzDevInfo.com

disk interview questions

Top disk frequently asked interview questions

Importance of Swap Partition

  • What is the purpose of a swap partition?
  • How do I know I have just enough swap partition? Not too much/little.

My Ubuntu PC is used for typical stuff:

  • Web (email, facebook, etc.)
  • Some movies
  • gaming is rare

Source: (StackOverflow)

How to set up multiple hard drives as one volume?

I am about to set up box to basically be a file server. I plan on having multiple drives in the box, and would like to set them all up so that they appear to be a single drive. So I could essentially have it mounted at say /media and not really care which drive gets used. I am not sure what the correct terminology for doing this is, so my Google fu is useless in this situation.

So how do I set up multiple hard drives to appear as one single drive?


Source: (StackOverflow)

Advertisements

Increase partition size on which Ubuntu is installed?

I have Ubuntu installed on a drive. The problem is it is running low on disk space. This is installed on vmware. I expanded the virtual drive and booted into ubuntu. But when I opened gparted(sudo gparted), the move/resize option is unavailable. This is the partition Ubuntu is installed on, but I need to resize it. Any ideas? I am comfortable using command line


Source: (StackOverflow)

How to determine where biggest files/directories on my system are stored?

I was wondering how do you know where the largest files in my system are stored.

For example---

Disk Space Used: 1GB Java: 500MB Java Percentage: 50% maybe represented in a pie chart. Maybe?

I know this maybe a feature overkill. I sometimes forget having stored things and wonder why my disk is so full.

So basically a command that will allow me to run on the file system and provide me with information on disk space used.

Please and thank you.


Source: (StackOverflow)

How can I check my RAM and hard drive for errors?

What tools can I use to check that my memory and hard drive are still working correctly?


Source: (StackOverflow)

How do I rename a USB drive?

How exactly would I rename a USB drive?

I've read that you can go into the Disk Utility, the click on Edit Partition and there is an option to rename the label but I can't click in the area to rename.

Is there any other way?


Source: (StackOverflow)

How to run a checkdisk?

I suspect there might be bad sector on a disk. What tool is the best equivalent of the error checking tool of windows?

(I used ext3)


Source: (StackOverflow)

Mount single partition from image of entire disk (device)

I made an image of my entire disk with

dd if=/dev/sda of=/media/external_media/sda.img

Now the problem is I'd like to mount an ext4 filesystem that was on that disk but

mount -t ext4 -o loop /media/external_media/sda.img /media/sda_image

obviously gives a superblock error since the image contains the whole disk (mbr, other partitions) not just the partition I need. So I guess I should find a way to make the disk image show up in the /dev/ folder... Does anyone know how to do that?

PS: I can always dd back the image to the original disk, but that would be very inconvenient (I updated the OS and I'd like to keep it as it is)


Source: (StackOverflow)

How to find out how much disk space is remaining?

What is the command to find out how much disk space is being used/remaining?


Source: (StackOverflow)

Unable to format USB drive with Disks (udisks-error-quark, 0)

Upon trying to make a startup disk (USB) for Ubuntu 12.04, the system prevented boot loader installation. I'm getting message:

Error synchronizing after initial wipe: Timed out waiting for object (udisks-error-quark, 0)

Can I still use the startup disk?


Source: (StackOverflow)

Disk Utility: What's the difference between "Unmount" and "Safe Removal"?

System > Administration > Disk Utility

What's the difference between "Unmount Volume" and "Safe Removal"? Say you insert a flash drive and open the Disk Utility UI, if you click on "Safe Removal" you receive an "Error Detaching Drive" notification, because it's busy. You must first click the "Unmount Volume" button, and then follow it with the "Safe Removal" button.

A couple questions here: Does this mean all these times I've been "ejecting" the drive (via context menu) before removing it, I haven't been "safely" removing it? And what are the command line equivalents for the two different operations?

(This question was somewhat addressed here but the answers seem to contradict what I'm pointing out about the Disk Utility options. Thanks.)


Source: (StackOverflow)

How can I physically identify a single drive in a RAID array?

I have an external drive bay with 4 eSATA disks in it. My system has a 4-port eSATA card, as well as a pair of internal hardware RAID1 drives. The external drives are in software RAID1 pairs as /dev/md0 and /dev/md1. Both have been configured as LVM physical volumes to create my storagevg LVM volume group. Recently, a single drive went offline (I suspect cables), but there does not seem to be a good way to physically identify which drive I need to check, especially since initialization order isn't the same between boots. How can I find the disk needing attention?


Source: (StackOverflow)

What does end-to-end disk error mean?

I have opened Disks program today and noticed that there is FAILING in the Assessment column for the SMART status.

enter image description here

What does this error mean? Is it serious problem?

I have Lenovo G50-45 laptop, disk is 1 TB ST1000LM014-SSHD-8GB(LVD3).


Source: (StackOverflow)

Source code for 'df' command

Can someone tell me how to locate the source code for the 'df' command. My operating system is Ocelot.

Thanks!


Source: (StackOverflow)

How do I improve my server disk performance

I have an HP Microserver running Ubuntu 10.04 LTS. It's a low power server with 5 internal drive bays. I use it to backup my remote servers, VPSs and local laptops over the network. I want to get the best performance from the disks, but I don't know if it's setup optimally, so I'm looking for some advice.

My server runs rsnapshot multiple times a day to backup remote hosts. The actual incremental backup part takes very little time. The significant time is spent doing things like:-

/bin/cp -al /srv/rsnapshot/hourly.0 /srv/rsnapshot/hourly.1

Which takes about 2 hours. I realise there are a bazillion tiny files in there.

$ sudo du -hs hourly.1
659G    hourly.1

Also when rsnapshot deletes an old backup this can take a long time:-

/bin/rm -rf /srv/rsnapshot/daily.6/

Which takes about half an hour.

My questions are as follows, configuration of server and some IO stats are detailed below. I can of course provide more debug info if necessary:-

How can I identify where the bottlenecks are?

Am I reaching the limits of what's capable (IO wise) with this box?

Are there any performance tweaks I could make?

Should I use a different RAID level?

Would it make sense to swap two of the internal RAID disks (half of each mirror) with two 'other halves of the other mirror' on the external array?

Note: I'm somewhat not inclined to be doing things like compiling my own kernel. Ideally I'd like to stick on 10.04 LTS, unless there's some magic in later versions that makes this all work a lot quicker.

Internally the server has 1x160GB SATA boot disk and 4x2TB disks:-

Disk /dev/sde: 160.0 GB, 160041885696 bytes
Disk /dev/sdf: 2000.4 GB, 2000398934016 bytes
Disk /dev/sdh: 2000.4 GB, 2000398934016 bytes
Disk /dev/sdi: 2000.4 GB, 2000398934016 bytes
Disk /dev/sdg: 2000.4 GB, 2000398934016 bytes

The four internal 2TB disks are in a software MD RAID10 setup:-

md0 : active raid10 sdg1[3] sdh1[0] sdi1[2] sdf1[1]
      3907023872 blocks 64K chunks 2 near-copies [4/4] [UUUU]

Additionally I have an external EDGE10 drive enclosure which is connected via a PCI-E eSATA card and contains four more drives of 500GB:-

Disk /dev/sda: 500.1 GB, 500107862016 bytes
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
Disk /dev/sdc: 500.1 GB, 500107862016 bytes
Disk /dev/sdd: 500.1 GB, 500107862016 bytes

This is also setup as an MD RAID10 array

md1 : active raid10 sdb1[1] sda1[0] sdd1[3] sdc1[2]
      976767872 blocks 64K chunks 2 near-copies [4/4] [UUUU]

md0 and md1 are combined to make one big LVM. Note: I only recently added the external array, so it's pretty much blank, I don't think there are any blocks on it right now.

This is presented as an LVM volume:-

--- Logical volume ---
LV Name                /dev/data/data
VG Name                data
LV UUID                amZCgU-sQLi-R363-dUFx-Bcdf-iwlt-ZNnDp8
LV Write Access        read/write
LV Status              available
# open                 1
LV Size                4.54 TiB
Current LE             1190134
Segments               2
Allocation             inherit
Read ahead sectors     auto
- currently set to     512
Block device           251:0

Which is formatted as EXT4 and mounted as /srv:-

/dev/mapper/data-data on /srv type ext4 (rw)

There's plenty of free space.

/dev/mapper/data-data
                      4.5T  2.2T  2.1T  51% /srv

Other information that might be useful:-

$ uname -a
Linux ubuntuserver 2.6.32-32-server #62-Ubuntu SMP Wed Apr 20 22:07:43 UTC 2011 x86_64 GNU/Linux

.

00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] (rev 40)
02:00.0 RAID bus controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)

When doing the cp command during rsnapshot I see the following in iostat:-

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.55    0.00    5.47   66.14    0.00   27.85

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdd               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sde               0.00     0.00    0.10    0.00     0.80     0.00     8.00     0.00    0.00   0.00   0.00
sdf               0.00   407.50    0.00   66.80     0.00  3790.40    56.74   124.86 1524.88  13.55  90.50
sdh               0.00   406.90    0.00   66.90     0.00  3790.40    56.66    92.89 1230.52  13.21  88.40
sdi               0.00   407.80    5.50   70.20    44.00  3824.00    51.10   113.83 1333.84  12.34  93.40
sdg               0.00   406.80    6.10   71.60    48.80  3827.20    49.88    64.32  787.68  11.69  90.80
md0               0.00     0.00   11.50 1484.60    92.00 11876.80     8.00     0.00    0.00   0.00   0.00
dm-0              0.00     0.00   11.50 1484.70    92.00 11877.60     8.00  5331.18  471.91   0.63  94.70
md1               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

So basically lots of writes, plenty of IO wait.

So right now the box is idle, I have suspended all jobs.

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.00    0.00  100.00

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdd               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sde               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdf               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdh               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdi               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdg               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
md0               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
md1               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

Looks peachy!

$ sudo hdparm -T -t /dev/sd[a-i]

/dev/sda:
 Timing cached reads:   2532 MB in  2.00 seconds = 1265.95 MB/sec
 Timing buffered disk reads:  270 MB in  3.02 seconds =  89.53 MB/sec

/dev/sdb:
 Timing cached reads:   2516 MB in  2.00 seconds = 1258.07 MB/sec
 Timing buffered disk reads:  264 MB in  3.02 seconds =  87.37 MB/sec

/dev/sdc:
 Timing cached reads:   2442 MB in  2.00 seconds = 1220.80 MB/sec
 Timing buffered disk reads:  272 MB in  3.00 seconds =  90.60 MB/sec

/dev/sdd:
 Timing cached reads:   2520 MB in  2.00 seconds = 1259.64 MB/sec
 Timing buffered disk reads:  272 MB in  3.02 seconds =  90.07 MB/sec

/dev/sde:
 Timing cached reads:   2524 MB in  2.00 seconds = 1261.48 MB/sec
 Timing buffered disk reads:  306 MB in  3.01 seconds = 101.56 MB/sec

/dev/sdf:
 Timing cached reads:   2366 MB in  2.00 seconds = 1183.28 MB/sec
 Timing buffered disk reads:  388 MB in  3.01 seconds = 128.88 MB/sec

/dev/sdg:
 Timing cached reads:   2536 MB in  2.00 seconds = 1267.52 MB/sec
 Timing buffered disk reads:  400 MB in  3.00 seconds = 133.12 MB/sec

/dev/sdh:
 Timing cached reads:   2538 MB in  2.00 seconds = 1269.08 MB/sec
 Timing buffered disk reads:  426 MB in  3.00 seconds = 141.90 MB/sec

/dev/sdi:
 Timing cached reads:   2538 MB in  2.00 seconds = 1268.57 MB/sec
 Timing buffered disk reads:  402 MB in  3.01 seconds = 133.69 MB/sec

Source: (StackOverflow)